diff options
-rw-r--r-- | hm/soispha/conf/taskwarrior/hooks/default.nix | 3 | ||||
-rw-r--r-- | hm/soispha/pkgs/default.nix | 3 | ||||
-rw-r--r-- | hm/soispha/pkgs/scripts.nix | 13 | ||||
-rwxr-xr-x | hm/soispha/pkgs/scripts/wrappers/neorg | 9 |
4 files changed, 26 insertions, 2 deletions
diff --git a/hm/soispha/conf/taskwarrior/hooks/default.nix b/hm/soispha/conf/taskwarrior/hooks/default.nix index f2a6579c..a8ce09cc 100644 --- a/hm/soispha/conf/taskwarrior/hooks/default.nix +++ b/hm/soispha/conf/taskwarrior/hooks/default.nix @@ -29,6 +29,7 @@ projects = lib.lists.unique (lib.lists.naturalSort (lib.lists.flatten (builtins.map mkProjectName (import ../projects {})))); projects_newline = builtins.concatStringsSep "\n" projects; projects_comma = builtins.concatStringsSep ", " projects; + projects_pipe = builtins.concatStringsSep "|" projects; enforce_policies = sysLib.writeShellScriptWithLibrary { name = "bin"; @@ -84,7 +85,7 @@ in { }; config = { soispha.taskwarrior.projects = { - inherit projects_newline projects_comma projects; + inherit projects_newline projects_comma projects projects_pipe; }; home.file = { diff --git a/hm/soispha/pkgs/default.nix b/hm/soispha/pkgs/default.nix index 3dd88293..8541e667 100644 --- a/hm/soispha/pkgs/default.nix +++ b/hm/soispha/pkgs/default.nix @@ -1,5 +1,6 @@ { pkgs, + lib, sysLib, system, config, @@ -10,7 +11,7 @@ ... }: with pkgs; let - shell-scripts = (import ./scripts.nix) {inherit pkgs sysLib config;}; + shell-scripts = (import ./scripts.nix) {inherit pkgs lib sysLib config;}; Gui = { Terminals = [ diff --git a/hm/soispha/pkgs/scripts.nix b/hm/soispha/pkgs/scripts.nix index a5c7655d..2fe8b3c7 100644 --- a/hm/soispha/pkgs/scripts.nix +++ b/hm/soispha/pkgs/scripts.nix @@ -1,5 +1,6 @@ { pkgs, + lib, sysLib, config, ... @@ -58,6 +59,18 @@ HOME_TASKRC = "${config.xdg.configHome}/task/home-manager-taskrc"; ALL_PROJECTS_NEWLINE = "${config.soispha.taskwarrior.projects.projects_newline}"; ALL_PROJECTS_COMMA = "${config.soispha.taskwarrior.projects.projects_comma}"; + ALL_PROJECTS_PIPE = "${config.soispha.taskwarrior.projects.projects_pipe}"; + ALL_WORKSPACES = "${lib.strings.concatStringsSep "|" (builtins.attrNames config.programs.nixvim.plugins.neorg.modules."core.dirman".config.workspaces)}"; + ID_GENERATION_FUNCTION = + # This is here, because escaping the whole function, to use it in the shell script + # directly just isn't possible + lib.strings.escapeShellArg + /* + bash + */ + '' + `(wc="$(task project:"$(task _get rc.context)" _ids)"; if [ "$wc" ]; then echo "$wc"; else echo "0"; fi ) | xargs task _zshids | awk -F: -v s="'" '{print $1 ":" s $2 s}'` + ''; # TODO: Replace the hard-coded path here with some reference <2023-10-20> TASK_PROJECT_FILE = "/home/soispha/repos/nix/nixos-config/hm/soispha/conf/taskwarrior/projects/default.nix"; diff --git a/hm/soispha/pkgs/scripts/wrappers/neorg b/hm/soispha/pkgs/scripts/wrappers/neorg index 7089350e..f5454d5c 100755 --- a/hm/soispha/pkgs/scripts/wrappers/neorg +++ b/hm/soispha/pkgs/scripts/wrappers/neorg @@ -41,6 +41,15 @@ COMMANDS: add Allows you to quickly add projects +ARGUMENTS: + ID | *([0-9]) := %ID_GENERATION_FUNCTION + The function displays all possible IDs of the eligable tasks. + + WS := %ALL_WORKSPACES + All possible workspaces + + P := %ALL_PROJECTS_PIPE + The possible project EOF } |