diff options
| author | Yigit Sever | 2021-08-24 12:49:51 +0300 | 
|---|---|---|
| committer | Yigit Sever | 2021-08-24 12:49:51 +0300 | 
| commit | 72786e7c0d5c7eda3e87c9f0097c9ad9d80cc49b (patch) | |
| tree | 89d7be7fc413f7e13369e665787355b6bff74f82 /.local/bin/done | |
| parent | 7d3766f8447585b9ce0f301e416742bcdefa1e1e (diff) | |
| download | dotfiles-72786e7c0d5c7eda3e87c9f0097c9ad9d80cc49b.tar.gz dotfiles-72786e7c0d5c7eda3e87c9f0097c9ad9d80cc49b.tar.bz2 dotfiles-72786e7c0d5c7eda3e87c9f0097c9ad9d80cc49b.zip | |
script: better done script
Diffstat (limited to '.local/bin/done')
| -rwxr-xr-x | .local/bin/done | 22 | 
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 | |||
| 10 | function say_cancel { notify-send "cancelling, no action taken" "" --app-name="done" --icon="dialog-cancel"; } | 6 | function say_cancel { notify-send "cancelling, no action taken" "" --app-name="done" --icon="dialog-cancel"; } | 
| 11 | 7 | ||
| 12 | if ACTIVE_TASK=$(task active); then | 8 | if 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 | 
