aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-12-28 13:58:10 +0100
committerSoispha <soispha@vhack.eu>2023-12-28 13:58:10 +0100
commite628885761de443cc2bd4a618ee100e45603bc40 (patch)
tree364c496a74f1cbbfce290617465cb673cdfc9a9f
parentfeat(hm/pkgs/scr/neorg): Change the active task and context when opening browser (diff)
downloadnixos-config-e628885761de443cc2bd4a618ee100e45603bc40.zip
feat(hm/pkgs/scr/neorg): Add a subcommand to making starting task easier
Diffstat (limited to '')
-rw-r--r--hm/soispha/conf/taskwarrior/default.nix1
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/neorg20
2 files changed, 21 insertions, 0 deletions
diff --git a/hm/soispha/conf/taskwarrior/default.nix b/hm/soispha/conf/taskwarrior/default.nix
index ce72feda..4487e360 100644
--- a/hm/soispha/conf/taskwarrior/default.nix
+++ b/hm/soispha/conf/taskwarrior/default.nix
@@ -89,6 +89,7 @@
alias = {
mod = "modify";
n = "execute neorg --task";
+ fstart = "execute neorg fstart";
};
color = true;
diff --git a/hm/soispha/pkgs/scripts/wrappers/neorg b/hm/soispha/pkgs/scripts/wrappers/neorg
index f11772ae..dda81308 100755
--- a/hm/soispha/pkgs/scripts/wrappers/neorg
+++ b/hm/soispha/pkgs/scripts/wrappers/neorg
@@ -46,6 +46,10 @@ COMMANDS:
add
Allows you to quickly add projects
+
+ fstart [ID]
+ Starts the task (ID) but only after it stooped
+ the previous active task, if it existed.
ARGUMENTS:
ID | *([0-9]) := [[$(cat %ID_GENERATION_FUNCTION)]]
The function displays all possible IDs of the eligable tasks.
@@ -208,6 +212,15 @@ ADD_open_taskwarrior_project_file() {
fi
}
# }}}
+# {{{
+FSTART_start_new_task() {
+ task_id="$1";
+ # we provided that only one task may be active
+ active="$(task +ACITVE _ids)";
+ [ "$active" ] && task stop "$active";
+ task start "$task_id"
+}
+# }}}
for arg in "$@"; do
case "$arg" in
@@ -263,6 +276,13 @@ while [ "$#" -ne 0 ]; do
DMENU_open_context_in_browser;
exit 0
;;
+ "f"*) # fstart
+ shift 1;
+ task_id="$1";
+ [ "$task_id" ] || die "No task id provided to fstart";
+ FSTART_start_new_task "$task_id";
+ exit 0
+ ;;
*)
die "Command '$1' does not exist! Please look at:\n $NAME --help";
exit 0;