X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/55893f4089b3fbf9e599263bb9c751c0d37f88a9..9aa8aa5122d0208fd4177f436e9b60ab868e204c:/.zsh/zshrc/parts.d/50-taskwarrior?ds=sidebyside diff --git a/.zsh/zshrc/parts.d/50-taskwarrior b/.zsh/zshrc/parts.d/50-taskwarrior index 53bdcc4..51d993f 100644 --- a/.zsh/zshrc/parts.d/50-taskwarrior +++ b/.zsh/zshrc/parts.d/50-taskwarrior @@ -1,7 +1,7 @@ # -# display ready taskwarrior tasks +# taskwarrior shell integration # -# Copyright © 1994–2017 martin f. krafft +# Copyright © 2018 martin f. krafft # Released under the terms of the Artistic Licence 2.0 # # Source repository: http://git.madduck.net/v/etc/zsh.git @@ -9,21 +9,24 @@ if whence task >/dev/null; then - alias t=task + function t() { task "$@"; } + + alias t\?='alias -rm t[-+a-z]' alias ta='t add' + alias tc='t call' + alias th='t attach' alias tn='t next' alias tl='t all' alias ty='t sync' alias td='t done' + alias te='t edit' + alias tu='t undo' + alias tm='t modify' + alias ts='t start' + alias t+='t annotate' - local SENTINEL=${XDG_RUNTIME_DIR}/taskwarrior/shell_run_sentinel - mkdir --parent ${SENTINEL%/*} - # only print the tasks at most once every 30 seconds - if [[ -t 0 ]] && [[ -z ${SENTINEL}(#qNms-30) ]]; then - touch ${SENTINEL} - task rc.color:off 2>/dev/null || : - fi - unset SENTINEL + run_at_most_every 5m \ + t 2>/dev/null || : fi # vim:ft=zsh