]> git.rmz.io Git - dotfiles.git/blob - zsh/lib/50-taskwarrior.zsh
84ee1ff105292586546566c9f89d472e5a2eb600
[dotfiles.git] / zsh / lib / 50-taskwarrior.zsh
1 if (( ! $+commands[task] )); then
2 return 1
3 fi
4
5 alias task="noglob task"
6 alias t="task"
7 alias tt="task today"
8
9 alias in="task add +in"
10 alias inn="in rc.context=none"
11
12 alias tw="task context wfh"
13 alias th="task context home"
14
15 alias tlatest="t +LATEST"
16
17 autoload -Uz task-quote-magic
18 zle -N self-insert task-quote-magic
19
20 function tparent() {
21 # TODO: check args
22 task _get $1.rparent
23 }
24
25 function tick() {
26 # TODO: have duration as an option to allow multiple filter
27 if (( # < 1 || # > 2)); then
28 print >&2 "Usage: $0 <filter> [duration]"
29 return 1
30 fi
31 task $1 mod wait:${2:-1h}
32 }
33
34 # TODO: function to show the latest report
35
36 function task_today_list() {
37 local task_cmd=(task rc.verbose:nothing)
38 local task_count=$($task_cmd $($task_cmd _get rc.report.today.filter) count)
39
40 local task_status=""
41 task_status+="%{$fg_bold[red]%} $task_count "
42 task_status+="%{$reset_color%}"
43 echo $task_status
44 }