From: Samir Benmendil Date: Sun, 7 Dec 2025 20:51:08 +0000 (+0000) Subject: zsh: add `turg` function to get most urgent task X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/ced721374ed8d79bb05e4971e0738f0df067f408 zsh: add `turg` function to get most urgent task --- diff --git a/zsh/lib/50-taskwarrior.zsh b/zsh/lib/50-taskwarrior.zsh index 84ee1ff..4e6c848 100644 --- a/zsh/lib/50-taskwarrior.zsh +++ b/zsh/lib/50-taskwarrior.zsh @@ -31,6 +31,13 @@ function tick() { 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() {