dotfiles/office/.config/sh/alias.d/taskwarrior.sh
Marty Oehme f45e41b754
office: Add active task modificaiton tw aliases
Added aliases to the shell to quickly Stop a currently Active Task
(`tas`) or to quickly log a currently Active Task as Done (`tad`).
2022-12-20 12:06:34 +01:00

35 lines
1 KiB
Bash

#!/usr/bin/env sh
# invoking t starts the task shell
# passing arguments along passes them straight through to taskwarrior instead
t() {
# check for existence of tasksh before doing this whole song and dance
if type tasksh >/dev/null 2>&1 && [ "$#" -eq 0 ]; then
tasksh
else
task "$@"
fi
}
# copy the `task` zsh completions over to my little alias 😉
# this is not very pretty and not super portable (needs ps) but
# works for now. from here: https://unix.stackexchange.com/a/72564/414758
if [ "$(ps -p $$ -o comm --no-headers)" = "zsh" ]; then compdef t=task; fi
# Make taskopen XDG conforming. If changing here, also change in taskrc alias.
alias taskopen='taskopen --config=${XDG_CONFIG_HOME:-~/.config}/task/taskopenrc'
alias ta="task add"
alias tal="task log"
alias tan="task annotate"
alias tn="task next +READY"
alias tun="task next urgency \> 4"
alias tra="task active"
alias trw="task end.after:today-1wk completed"
alias tad="task +ACTIVE done"
alias tas="task +ACTIVE stop"
alias to="task open"