From 72786e7c0d5c7eda3e87c9f0097c9ad9d80cc49b Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Tue, 24 Aug 2021 12:49:51 +0300 Subject: script: better done script --- .local/bin/done | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to '.local/bin') 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 @@ # we `start` tasks through taskwarrior which uses a hook to start them in # timewarrior -# DONE: START: get the tasks for the current context, start using rofi selection -# DONE: STOP: get the current task (task active output), either pause it (task $1 stop) or complete it (task $1 done) -# DONE: DONE: ask how the task went, timew @1 annotate '[1-5]' - function say_cancel { notify-send "cancelling, no action taken" "" --app-name="done" --icon="dialog-cancel"; } if ACTIVE_TASK=$(task active); then @@ -19,11 +15,6 @@ if ACTIVE_TASK=$(task active); then if [[ ${choice} == "done" ]]; then task "done" "${task_id}" notify-send "👏👏👏 good work there" "task ${task_description} is complete" --app-name="done" --icon="checkmark" - - 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 - timew "@1" annotate "${annot:0:1}" - fi - elif [[ ${choice} == "pause" ]]; then task "stop" "${task_id}" 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 echo "this is impossible..." exit 1 fi + + 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 + timew "@1" annotate "${annot:0:1}" + else + if maybe_delete=$(printf "no no\nyea" | rofi -dmenu -p "should we delete the tracking?" -lines 2 -no-custom); then + if [[ "${maybe_delete}" == "no no" ]]; then + notify-send "tracking unannotated, not deleted" "nobody will know how that went" --app-name="done" --icon="itmages-question" + elif [[ "${maybe_delete}" == "yea" ]]; then + timew delete "@1" + notify-send "tracking deleted" "like you never worked on that" --app-name="done" --icon="pack-more" + fi + fi + fi else say_cancel fi -- cgit v1.2.3-70-g09d2