aboutsummaryrefslogtreecommitdiffstats
path: root/hm/soispha/pkgs/scripts/wrappers
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-12-31 15:48:39 +0100
committerSoispha <soispha@vhack.eu>2023-12-31 15:48:39 +0100
commit7853b108fbf40f1ff20c535498d6a5eec857207c (patch)
treea8f2914e8fab59e3a84db4a4fc042cbead1a66d5 /hm/soispha/pkgs/scripts/wrappers
parentbuild(treewide): Update (diff)
downloadnixos-config-7853b108fbf40f1ff20c535498d6a5eec857207c.zip
feat(hm/pkgs/neorg): Add a subcommand to stop the currently active task
Diffstat (limited to 'hm/soispha/pkgs/scripts/wrappers')
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/neorg/neorg16
1 files changed, 14 insertions, 2 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/neorg/neorg b/hm/soispha/pkgs/scripts/wrappers/neorg/neorg
index 5d229d51..e1100628 100755
--- a/hm/soispha/pkgs/scripts/wrappers/neorg/neorg
+++ b/hm/soispha/pkgs/scripts/wrappers/neorg/neorg
@@ -50,6 +50,9 @@ COMMANDS:
fstart [ID]
Starts the task (ID) but only after it stooped
the previous active task, if it existed.
+
+ fstop
+ Stops the current active task
ARGUMENTS:
ID | *([0-9]) := [[%ID_GENERATION_FUNCTION]]
The function displays all possible IDs of the eligable tasks.
@@ -232,10 +235,15 @@ ADD_open_taskwarrior_project_file() {
# fStart {{{
FSTART_start_new_task() {
task_id="$1";
+ FSTOP_stop_current_task;
+ task start "$task_id"
+}
+# }}}
+# fStop {{{
+FSTOP_stop_current_task() {
# we ensured that only one task may be active
active="$(task +ACTIVE _ids)";
[ "$active" ] && task stop "$active";
- task start "$task_id"
}
# }}}
@@ -293,13 +301,17 @@ while [ "$#" -ne 0 ]; do
DMENU_open_context_in_browser;
exit 0
;;
- "f"*) # fstart
+ "fsta"*) # fstart
shift 1;
task_id="$1";
[ "$task_id" ] || die "No task id provided to fstart";
FSTART_start_new_task "$task_id";
exit 0
;;
+ "fsto"*) # fstop
+ FSTOP_stop_current_task;
+ exit 0
+ ;;
*)
die "Command '$1' does not exist! Please look at:\n $NAME --help";
exit 0;