diff options
Diffstat (limited to 'pkgs/desktops/gnome/extensions/taskwhisperer')
-rw-r--r-- | pkgs/desktops/gnome/extensions/taskwhisperer/default.nix | 42 | ||||
-rw-r--r-- | pkgs/desktops/gnome/extensions/taskwhisperer/fix-paths.patch | 99 |
2 files changed, 141 insertions, 0 deletions
diff --git a/pkgs/desktops/gnome/extensions/taskwhisperer/default.nix b/pkgs/desktops/gnome/extensions/taskwhisperer/default.nix new file mode 100644 index 0000000000000..68d07e2d1429a --- /dev/null +++ b/pkgs/desktops/gnome/extensions/taskwhisperer/default.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, substituteAll, fetchFromGitHub, taskwarrior, gettext, runtimeShell }: + +stdenv.mkDerivation rec { + pname = "gnome-shell-extension-taskwhisperer"; + version = "16"; + + src = fetchFromGitHub { + owner = "cinatic"; + repo = "taskwhisperer"; + rev = "v${version}"; + sha256 = "05w2dfpr5vrydb7ij4nd2gb7c31nxix3j48rb798r4jzl1rakyah"; + }; + + nativeBuildInputs = [ + gettext + ]; + + buildInputs = [ + taskwarrior + ]; + + uuid = "taskwhisperer-extension@infinicode.de"; + + makeFlags = [ + "INSTALLBASE=${placeholder "out"}/share/gnome-shell/extensions" + ]; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + task = "${taskwarrior}/bin/task"; + shell = runtimeShell; + }) + ]; + + meta = with 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/extensions/taskwhisperer/fix-paths.patch b/pkgs/desktops/gnome/extensions/taskwhisperer/fix-paths.patch new file mode 100644 index 0000000000000..2ea54f4b0897d --- /dev/null +++ b/pkgs/desktops/gnome/extensions/taskwhisperer/fix-paths.patch @@ -0,0 +1,99 @@ +diff --git a/taskwhisperer-extension@infinicode.de/extra/create.sh b/taskwhisperer-extension@infinicode.de/extra/create.sh +index a69e369..35d5ea1 100755 +--- a/taskwhisperer-extension@infinicode.de/extra/create.sh ++++ b/taskwhisperer-extension@infinicode.de/extra/create.sh +@@ -1 +1 @@ +-bash -c "task add $1" ++bash -c "@task@ add $1" +diff --git a/taskwhisperer-extension@infinicode.de/extra/modify.sh b/taskwhisperer-extension@infinicode.de/extra/modify.sh +index 7964a26..8edd21b 100755 +--- a/taskwhisperer-extension@infinicode.de/extra/modify.sh ++++ b/taskwhisperer-extension@infinicode.de/extra/modify.sh +@@ -1 +1 @@ +-bash -c "task $1 modify $2" ++bash -c "@task@ $1 modify $2" +diff --git a/taskwhisperer-extension@infinicode.de/taskService.js b/taskwhisperer-extension@infinicode.de/taskService.js +index ead7a12..aa36db4 100644 +--- a/taskwhisperer-extension@infinicode.de/taskService.js ++++ b/taskwhisperer-extension@infinicode.de/taskService.js +@@ -182,7 +182,7 @@ const TaskService = class TaskService { + + 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 = ""; +@@ -220,7 +220,7 @@ const TaskService = class TaskService { + 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; +@@ -261,7 +261,7 @@ const TaskService = class TaskService { + 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; +@@ -290,7 +290,7 @@ const TaskService = class TaskService { + 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; +@@ -318,7 +318,7 @@ const TaskService = class TaskService { + if (!taskID) { + 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); +@@ -344,7 +344,7 @@ const TaskService = class TaskService { + if (!taskID) { + 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); +@@ -374,7 +374,7 @@ const TaskService = class TaskService { + // FIXME: Gio.Subprocess: due to only passing string vector is allowed, it's not possible to directly pass the + // input of the user to subprocess (why & how, if you can answer then please send msg to fh@infinicode.de) + // bypassing problem with own shell script +- let shellProc = Gio.Subprocess.new(['/bin/sh', EXTENSIONDIR + '/extra/modify.sh', taskID.toString(), params], Gio.SubprocessFlags.STDOUT_PIPE + Gio.SubprocessFlags.STDERR_MERGE); ++ let shellProc = Gio.Subprocess.new(['@shell@', EXTENSIONDIR + '/extra/modify.sh', taskID.toString(), params], Gio.SubprocessFlags.STDOUT_PIPE + Gio.SubprocessFlags.STDERR_MERGE); + + shellProc.wait_async(null, function (obj, result) { + let shellProcExited = true; +@@ -403,7 +403,7 @@ const TaskService = class TaskService { + // FIXME: Gio.Subprocess: due to only passing string vector is allowed, it's not possible to directly pass the + // input of the user to subprocess (why & how, if you can answer then please send msg to fh@infinicode.de) + // bypassing problem with own shell script +- let shellProc = Gio.Subprocess.new(['/bin/sh', EXTENSIONDIR + '/extra/create.sh', params], Gio.SubprocessFlags.STDOUT_PIPE + Gio.SubprocessFlags.STDERR_MERGE); ++ let shellProc = Gio.Subprocess.new(['@shell@', EXTENSIONDIR + '/extra/create.sh', params], Gio.SubprocessFlags.STDOUT_PIPE + Gio.SubprocessFlags.STDERR_MERGE); + + shellProc.wait_async(null, function (obj, result) { + let shellProcExited = true; +@@ -432,7 +432,7 @@ const TaskService = class TaskService { + let shellProc; + + try { +- shellProc = Gio.Subprocess.new(['task', 'sync'], Gio.SubprocessFlags.STDOUT_PIPE); ++ shellProc = Gio.Subprocess.new(['@task@', 'sync'], Gio.SubprocessFlags.STDOUT_PIPE); + } catch (err) { + onError(err); + return; |