diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-24 13:54:03 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-24 13:54:03 +0900 |
| commit | 28e8bdf7f8286bd431b7f3b709e79f3827b31469 (patch) | |
| tree | 85b44eff6da4d8443198fb6e04dfb6ee55244588 /debian/.local/bin/task/taskwarrior-tui/cycle-priority | |
| parent | 8470ff001befcfd0f626dea69a9e76d43aee0511 (diff) | |
updates
Diffstat (limited to 'debian/.local/bin/task/taskwarrior-tui/cycle-priority')
| -rwxr-xr-x | debian/.local/bin/task/taskwarrior-tui/cycle-priority | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/.local/bin/task/taskwarrior-tui/cycle-priority b/debian/.local/bin/task/taskwarrior-tui/cycle-priority new file mode 100755 index 0000000..43bc91e --- /dev/null +++ b/debian/.local/bin/task/taskwarrior-tui/cycle-priority @@ -0,0 +1,35 @@ +#!/bin/sh + +uuid="$1" + +# Get the current priority of the task +current_priority=$(task _get $uuid.priority) + +# Cycle through the priorities: H -> M -> L -> (unset) -> H +case "$current_priority" in +H) + new_priority="M" + echo "Switching priority from 'H' to 'M'" + ;; +M) + new_priority="L" + echo "Switching priority from 'M' to 'L'" + ;; +L) + new_priority="" + echo "Switching priority from 'L' to (no priority)" + ;; +"") + new_priority="H" + echo "Switching priority from (no priority) to 'H'" + ;; +esac + +# Update the task with the new priority value, or remove priority if it's an empty string +if [ -n "$new_priority" ]; then + echo "Updating task $uuid with new priority: $new_priority" + task rc.bulk=0 rc.confirmation=off "$uuid" modify priority="$new_priority" +else + echo "Removing priority from task $uuid" + task rc.bulk=0 rc.confirmation=off "$uuid" modify priority: +fi |
