]> git.rmz.io Git - dotfiles.git/commitdiff
zsh: tick function to wait a while for a task
authorSamir Benmendil <me@rmz.io>
Thu, 13 Mar 2025 20:56:06 +0000 (20:56 +0000)
committerSamir Benmendil <me@rmz.io>
Thu, 13 Mar 2025 22:02:57 +0000 (22:02 +0000)
zsh/lib/50-taskwarrior.zsh

index ce423cff03e21f842262561667c7f7b0e6246618..92f56bb41c4b58f37065f9707f24a8e15022cfe7 100644 (file)
@@ -18,6 +18,14 @@ function tparent() {
     task _get $1.rparent
 }
 
+function tick() {
+    if (( # < 1 || # > 2)); then
+        print >&2 "Usage: $0 <filter> [duration]"
+        return 1
+    fi
+    task $1 mod wait:${2:-1h}
+}
+
 function task_today_list() {
   local task_cmd=(task rc.verbose:nothing)
   local task_count=$($task_cmd $($task_cmd _get rc.report.today.filter) count)