aboutsummaryrefslogtreecommitdiffstats
path: root/hm/soispha/pkgs
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-10-25 15:18:09 +0200
committerSoispha <soispha@vhack.eu>2023-10-25 15:18:09 +0200
commit773d7bc152330541d1b262fccf9126bc39500f31 (patch)
treef3b987cc76fef8690844a1068b9f14a69e7faabc /hm/soispha/pkgs
parentbuild(treewide): Update (+ shell-library) (diff)
downloadnixos-config-773d7bc152330541d1b262fccf9126bc39500f31.zip
feat(hm/pkgs/scr/neorg): Update help to include ARGUMENTS section
Diffstat (limited to 'hm/soispha/pkgs')
-rw-r--r--hm/soispha/pkgs/default.nix3
-rw-r--r--hm/soispha/pkgs/scripts.nix13
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/neorg9
3 files changed, 24 insertions, 1 deletions
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
}