about summary refs log tree commit diff stats
path: root/hm/soispha
diff options
context:
space:
mode:
Diffstat (limited to 'hm/soispha')
-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;