diff options
Diffstat (limited to 'krebs/5pkgs/simple/Reaktor')
-rw-r--r-- | krebs/5pkgs/simple/Reaktor/default.nix | 6 | ||||
-rw-r--r-- | krebs/5pkgs/simple/Reaktor/plugins.nix | 68 | ||||
-rwxr-xr-x[-rw-r--r--] | krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh | 0 |
6 files changed, 28 insertions, 50 deletions
diff --git a/krebs/5pkgs/simple/Reaktor/default.nix b/krebs/5pkgs/simple/Reaktor/default.nix index 3ef9ffb7d..a88db6379 100644 --- a/krebs/5pkgs/simple/Reaktor/default.nix +++ b/krebs/5pkgs/simple/Reaktor/default.nix @@ -2,7 +2,7 @@ python3Packages.buildPythonPackage rec { name = "Reaktor-${version}"; - version = "0.6.2"; + version = "0.7.0"; doCheck = false; @@ -13,8 +13,8 @@ python3Packages.buildPythonPackage rec { src = fetchFromGitHub { owner = "krebs"; repo = "Reaktor"; - rev = version; - sha256 = "0h8pj0x9b5fnxddwrc0f63rxd3275v5phmjc0fv4kiwlzvbcxj6m"; + rev = "v${version}"; + sha256 = "12yy06vk0smjs0rmahrn2kd4bcdh1yjw1fz6rifw6nmgx889d9hj"; }; meta = { homepage = http://krebsco.de/; diff --git a/krebs/5pkgs/simple/Reaktor/plugins.nix b/krebs/5pkgs/simple/Reaktor/plugins.nix index 6f59ad1de..1b19a1178 100644 --- a/krebs/5pkgs/simple/Reaktor/plugins.nix +++ b/krebs/5pkgs/simple/Reaktor/plugins.nix @@ -146,58 +146,36 @@ rec { ''; }); - taskrcFile = builtins.toFile "taskrc" '' - confirmation=no - ''; - - task-add = buildSimpleReaktorPlugin "task-add" { - pattern = "^task-add: (?P<args>.*)$$"; - script = pkgs.writeDash "task-add" '' - ${pkgs.taskwarrior}/bin/task rc:${taskrcFile} add "$*" - ''; - }; - - task-list = buildSimpleReaktorPlugin "task-list" { - pattern = "^task-list"; - script = pkgs.writeDash "task-list" '' - ${pkgs.taskwarrior}/bin/task rc:${taskrcFile} export | ${pkgs.jq}/bin/jq -r '.[] | select(.id != 0) | "\(.id) \(.description)"' - ''; - }; - - task-delete = buildSimpleReaktorPlugin "task-delete" { - pattern = "^task-delete: (?P<args>.*)$$"; - script = pkgs.writeDash "task-delete" '' - ${pkgs.taskwarrior}/bin/task rc:${taskrcFile} delete "$*" - ''; - }; - - task-done = buildSimpleReaktorPlugin "task-done" { - pattern = "^task-done: (?P<args>.*)$$"; - script = pkgs.writeDash "task-done" '' - ${pkgs.taskwarrior}/bin/task rc:${taskrcFile} done "$*" - ''; - }; - - todo = name: { - add = buildSimpleReaktorPlugin "${name}-add" { + task = name: let + rcFile = builtins.toFile "taskrc" '' + confirmation=no + ''; + in { + add = buildSimpleReaktorPlugin "${name}-task-add" { pattern = "^${name}-add: (?P<args>.*)$$"; script = pkgs.writeDash "${name}-add" '' - echo "$*" >> ${name}-todo - echo "added ${name} todo" + TASKDATA=$HOME/${name} ${pkgs.taskwarrior}/bin/task rc:${rcFile} add "$*" ''; }; - delete = buildSimpleReaktorPlugin "${name}-delete" { + + list = buildSimpleReaktorPlugin "task-list" { + pattern = "^${name}-list"; + script = pkgs.writeDash "task-list" '' + TASKDATA=$HOME/${name} ${pkgs.taskwarrior}/bin/task rc:${rcFile} export | ${pkgs.jq}/bin/jq -r '.[] | select(.id != 0) | "\(.id) \(.description)"' + ''; + }; + + delete = buildSimpleReaktorPlugin "task-delete" { pattern = "^${name}-delete: (?P<args>.*)$$"; - script = pkgs.writeDash "${name}-delete" '' - ${pkgs.gnugrep}/bin/grep -Fvxe "$*" ${name}-todo > ${name}-todo.tmp - ${pkgs.coreutils}/bin/mv ${name}-todo.tmp ${name}-todo - echo "removed ${name} todo: $*" + script = pkgs.writeDash "task-delete" '' + TASKDATA=$HOME/${name} ${pkgs.taskwarrior}/bin/task rc:${rcFile} delete "$*" ''; }; - show = buildSimpleReaktorPlugin "${name}-show" { - pattern = "^${name}-show$"; - script = pkgs.writeDash "${name}-show" '' - ${pkgs.coreutils}/bin/cat ${name}-todo + + done = buildSimpleReaktorPlugin "task-done" { + pattern = "^${name}-done: (?P<args>.*)$$"; + script = pkgs.writeDash "task-done" '' + TASKDATA=$HOME/${name} ${pkgs.taskwarrior}/bin/task rc:${rcFile} done "$*" ''; }; }; diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh b/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh index 386aa68b9..6f3dd4a3f 100644..100755 --- a/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh +++ b/krebs/5pkgs/simple/Reaktor/scripts/random-emoji.sh @@ -1,5 +1,5 @@ #!/bin/sh -curl http://emojicons.com/random -s | \ +curl -sS http://emojicons.com/random | \ grep data-text | \ sed -n 's/.*>\(.*\)<\/textarea>/\1/p' | \ head -n 1 | \ diff --git a/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh b/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh index 5c47c6156..5c47c6156 100644..100755 --- a/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh +++ b/krebs/5pkgs/simple/Reaktor/scripts/random-issue.sh diff --git a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py index ecb03917b..4925b25bb 100644..100755 --- a/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py +++ b/krebs/5pkgs/simple/Reaktor/scripts/sed-plugin.py @@ -46,7 +46,7 @@ if is_regex(line): print('to many lines, skipped') else: if last.strip() != ret.strip(): - print("\x1b[1m{}\x1b[0m meant: {}".format(usr, ret.strip())) + print("\x02{}\x02 meant: {}".format(usr, ret.strip())) if ret: d[usr] = ret diff --git a/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh b/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh index d500b3cb3..d500b3cb3 100644..100755 --- a/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh +++ b/krebs/5pkgs/simple/Reaktor/scripts/shack-correct.sh |