summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/done22
1 files changed, 13 insertions, 9 deletions
diff --git a/.local/bin/done b/.local/bin/done
index f2641f2..8bb0a3d 100755
--- a/.local/bin/done
+++ b/.local/bin/done
@@ -3,10 +3,6 @@
3# we `start` tasks through taskwarrior which uses a hook to start them in 3# we `start` tasks through taskwarrior which uses a hook to start them in
4# timewarrior 4# timewarrior
5 5
6# DONE: START: get the tasks for the current context, start using rofi selection
7# DONE: STOP: get the current task (task active output), either pause it (task $1 stop) or complete it (task $1 done)
8# DONE: DONE: ask how the task went, timew @1 annotate '[1-5]'
9
10function say_cancel { notify-send "cancelling, no action taken" "" --app-name="done" --icon="dialog-cancel"; } 6function say_cancel { notify-send "cancelling, no action taken" "" --app-name="done" --icon="dialog-cancel"; }
11 7
12if ACTIVE_TASK=$(task active); then 8if ACTIVE_TASK=$(task active); then
@@ -19,11 +15,6 @@ if ACTIVE_TASK=$(task active); then
19 if [[ ${choice} == "done" ]]; then 15 if [[ ${choice} == "done" ]]; then
20 task "done" "${task_id}" 16 task "done" "${task_id}"
21 notify-send "👏👏👏 good work there" "task ${task_description} is complete" --app-name="done" --icon="checkmark" 17 notify-send "👏👏👏 good work there" "task ${task_description} is complete" --app-name="done" --icon="checkmark"
22
23 if annot=$(printf "5 - perfect flow\n4 - progress, still\n3 - rather be somewhere else\n2 - ugh\n1 - not even" | rofi -dmenu -p "${task_description}" -lines 5 -no-custom); then
24 timew "@1" annotate "${annot:0:1}"
25 fi
26
27 elif [[ ${choice} == "pause" ]]; then 18 elif [[ ${choice} == "pause" ]]; then
28 task "stop" "${task_id}" 19 task "stop" "${task_id}"
29 notify-send "🛑 let's put a pause on this" "stopping task ${task_description}" --app-name="done" --icon="dialog-apply" 20 notify-send "🛑 let's put a pause on this" "stopping task ${task_description}" --app-name="done" --icon="dialog-apply"
@@ -31,6 +22,19 @@ if ACTIVE_TASK=$(task active); then
31 echo "this is impossible..." 22 echo "this is impossible..."
32 exit 1 23 exit 1
33 fi 24 fi
25
26 if annot=$(printf "5 - perfect flow\n4 - progress, still\n3 - rather be somewhere else\n2 - ugh\n1 - not even" | rofi -dmenu -p "${task_description}" -lines 5 -no-custom); then
27 timew "@1" annotate "${annot:0:1}"
28 else
29 if maybe_delete=$(printf "no no\nyea" | rofi -dmenu -p "should we delete the tracking?" -lines 2 -no-custom); then
30 if [[ "${maybe_delete}" == "no no" ]]; then
31 notify-send "tracking unannotated, not deleted" "nobody will know how that went" --app-name="done" --icon="itmages-question"
32 elif [[ "${maybe_delete}" == "yea" ]]; then
33 timew delete "@1"
34 notify-send "tracking deleted" "like you never worked on that" --app-name="done" --icon="pack-more"
35 fi
36 fi
37 fi
34 else 38 else
35 say_cancel 39 say_cancel
36 fi 40 fi