about summary refs log tree commit diff
path: root/pkgs/desktops
diff options
context:
space:
mode:
authorJon Banafato <jon@jonafato.com>2018-02-17 01:55:06 -0500
committerJon Banafato <jon@jonafato.com>2018-02-19 10:55:36 -0500
commit05d9196f7b23107f514cf984736745b318282d13 (patch)
treeb472af942023ddeb137b5b1d473c1daf39eb6121 /pkgs/desktops
parent1e23a5a6e916ad5992916d7517af7b4fa928c812 (diff)
gnomeExtensions.taskwhisperer: init at v11
Add the TaskWhisperer GNOME Shell extension.
Diffstat (limited to 'pkgs/desktops')
-rw-r--r--pkgs/desktops/gnome-3/extensions/taskwhisperer/default.nix43
-rw-r--r--pkgs/desktops/gnome-3/extensions/taskwhisperer/fix-paths.patch81
2 files changed, 124 insertions, 0 deletions
diff --git a/pkgs/desktops/gnome-3/extensions/taskwhisperer/default.nix b/pkgs/desktops/gnome-3/extensions/taskwhisperer/default.nix
new file mode 100644
index 0000000000000..fcaa868c06f22
--- /dev/null
+++ b/pkgs/desktops/gnome-3/extensions/taskwhisperer/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, substituteAll, fetchFromGitHub, taskwarrior }:
+
+stdenv.mkDerivation rec {
+  name = "gnome-shell-extension-taskwhisperer-${version}";
+  version = "11";
+
+  src = fetchFromGitHub {
+    owner = "cinatic";
+    repo = "taskwhisperer";
+    rev = "v${version}";
+    sha256 = "1g1301rwnfg5jci78bjpmgxrn78ra80m1zp2inhfsm8jssr1i426";
+  };
+
+  buildInputs = [ taskwarrior ];
+
+  uuid = "taskwhisperer-extension@infinicode.de";
+
+  installPhase = ''
+    mkdir -p $out/share/gnome-shell/extensions/${uuid}
+    cp *.js $out/share/gnome-shell/extensions/${uuid}
+    cp -r extra $out/share/gnome-shell/extensions/${uuid}
+    cp -r icons $out/share/gnome-shell/extensions/${uuid}
+    cp -r locale $out/share/gnome-shell/extensions/${uuid}
+    cp -r schemas $out/share/gnome-shell/extensions/${uuid}
+    cp metadata.json $out/share/gnome-shell/extensions/${uuid}
+    cp settings.ui $out/share/gnome-shell/extensions/${uuid}
+    cp stylesheet.css $out/share/gnome-shell/extensions/${uuid}
+  '';
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      task = "${taskwarrior}/bin/task";
+    })
+  ];
+
+  meta = with stdenv.lib; {
+    description = "GNOME Shell TaskWarrior GUI";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ jonafato ];
+    homepage = https://github.com/cinatic/taskwhisperer;
+  };
+}
diff --git a/pkgs/desktops/gnome-3/extensions/taskwhisperer/fix-paths.patch b/pkgs/desktops/gnome-3/extensions/taskwhisperer/fix-paths.patch
new file mode 100644
index 0000000000000..310d6ea1b3052
--- /dev/null
+++ b/pkgs/desktops/gnome-3/extensions/taskwhisperer/fix-paths.patch
@@ -0,0 +1,81 @@
+diff --git a/extra/create.sh b/extra/create.sh
+index a69e369..35d5ea1 100755
+--- a/extra/create.sh
++++ b/extra/create.sh
+@@ -1 +1 @@
+-bash -c "task add $1"
++bash -c "@task@ add $1"
+diff --git a/extra/modify.sh b/extra/modify.sh
+index 7964a26..8edd21b 100755
+--- a/extra/modify.sh
++++ b/extra/modify.sh
+@@ -1 +1 @@
+-bash -c "task $1 modify $2"
++bash -c "@task@ $1 modify $2"
+diff --git a/taskService.js b/taskService.js
+index dea40d8..ff35a80 100644
+--- a/taskService.js
++++ b/taskService.js
+@@ -186,7 +186,7 @@ const TaskService = new Lang.Class({
+ 
+         let project = projectName ? "project:" + projectName : "";
+ 
+-        let command = ['task', 'rc.json.array=on', status, project, 'export'];
++        let command = ['@task@', 'rc.json.array=on', status, project, 'export'];
+         let reader = new SpawnReader.SpawnReader();
+ 
+         let buffer = "";
+@@ -227,7 +227,7 @@ const TaskService = new Lang.Class({
+                 break;
+         }
+ 
+-        let shellProc = Gio.Subprocess.new(['task', status, 'projects'], Gio.SubprocessFlags.STDOUT_PIPE);
++        let shellProc = Gio.Subprocess.new(['@task@', status, 'projects'], Gio.SubprocessFlags.STDOUT_PIPE);
+ 
+         shellProc.wait_async(null, function(obj, result){
+             let shellProcExited = true;
+@@ -274,7 +274,7 @@ const TaskService = new Lang.Class({
+             return;
+         }
+ 
+-        let shellProc = Gio.Subprocess.new(['task', taskID.toString(), 'done'], Gio.SubprocessFlags.STDOUT_PIPE);
++        let shellProc = Gio.Subprocess.new(['@task@', taskID.toString(), 'done'], Gio.SubprocessFlags.STDOUT_PIPE);
+ 
+         shellProc.wait_async(null, function(obj, result){
+             let shellProcExited = true;
+@@ -307,7 +307,7 @@ const TaskService = new Lang.Class({
+             return;
+         }
+ 
+-        let shellProc = Gio.Subprocess.new(['task', 'modify', taskID.toString(), 'status:pending'], Gio.SubprocessFlags.STDOUT_PIPE);
++        let shellProc = Gio.Subprocess.new(['@task@', 'modify', taskID.toString(), 'status:pending'], Gio.SubprocessFlags.STDOUT_PIPE);
+ 
+         shellProc.wait_async(null, function(obj, result){
+             let shellProcExited = true;
+@@ -339,7 +339,7 @@ const TaskService = new Lang.Class({
+         {
+             return;
+         }
+-        let shellProc = Gio.Subprocess.new(['task', taskID.toString(), 'start'], Gio.SubprocessFlags.STDOUT_PIPE);
++        let shellProc = Gio.Subprocess.new(['@task@', taskID.toString(), 'start'], Gio.SubprocessFlags.STDOUT_PIPE);
+         shellProc.wait_async(null, function(obj, result){
+             let shellProcExited = true;
+             shellProc.wait_finish(result);
+@@ -369,7 +369,7 @@ const TaskService = new Lang.Class({
+         {
+             return;
+         }
+-        let shellProc = Gio.Subprocess.new(['task', taskID.toString(), 'stop'], Gio.SubprocessFlags.STDOUT_PIPE);
++        let shellProc = Gio.Subprocess.new(['@task@', taskID.toString(), 'stop'], Gio.SubprocessFlags.STDOUT_PIPE);
+         shellProc.wait_async(null, function(obj, result){
+             let shellProcExited = true;
+             shellProc.wait_finish(result);
+@@ -468,7 +468,7 @@ const TaskService = new Lang.Class({
+ 
+         try
+         {
+-            shellProc = Gio.Subprocess.new(['task', 'sync'], Gio.SubprocessFlags.STDOUT_PIPE);
++            shellProc = Gio.Subprocess.new(['@task@', 'sync'], Gio.SubprocessFlags.STDOUT_PIPE);
+         }
+         catch(err)
+         {