]> git.rmz.io Git - dotfiles.git/commitdiff
zsh: add `turg` function to get most urgent task
authorSamir Benmendil <me@rmz.io>
Sun, 7 Dec 2025 20:51:08 +0000 (20:51 +0000)
committerSamir Benmendil <me@rmz.io>
Sun, 7 Dec 2025 21:27:00 +0000 (21:27 +0000)
zsh/lib/50-taskwarrior.zsh

index 84ee1ff105292586546566c9f89d472e5a2eb600..4e6c8487a6802616c581d82e14dbb1c5fc85da5e 100644 (file)
@@ -31,6 +31,13 @@ function tick() {
     task $1 mod wait:${2:-1h}
 }
 
     task $1 mod wait:${2:-1h}
 }
 
+function turg() {
+    local context=$(task _get rc.context)
+    local context_read=$(task _get rc.context.$context.read)
+    local urg_task=$(task +READY $context_read _urgency | sort -k4 -n | tail -1 | cut -d" " -f2)
+    task $urg_task $@
+}
+
 # TODO: function to show the latest report
 
 function task_today_list() {
 # TODO: function to show the latest report
 
 function task_today_list() {