task: Integrate into office module

Since I am striving for closer connection between my task management, my
mail suite and my calendar appointments, it makes sense to unify all
'office' tasks into the single office module instead of keeping
taskwarrior outside of it.
This commit is contained in:
Marty Oehme 2022-12-08 14:02:16 +01:00
parent 4b4afc68f3
commit b534454a88
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9
13 changed files with 18 additions and 22 deletions

View file

@ -0,0 +1,32 @@
#!/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 to="task open"

View file

@ -0,0 +1,16 @@
#!/usr/bin/env sh
if ! exist timew; then
return 1
fi
# invoking tim without arguments prints out timesheet summary
# with ids attached.
# otherwise tim passes through any arguments to timew
tim() {
if [ "$#" -eq 0 ]; then
timew summary :ids
else
timew "$@"
fi
}

View file

@ -0,0 +1,6 @@
#!/usr/bin/env sh
# Ensure necessary taskwarrior includes exist
[ -e "${XDG_CONFIG_HOME:-$HOME/.config}/task/contexts" ] || touch "${XDG_CONFIG_HOME:-$HOME/.config}/task/contexts"
[ -e "${XDG_CONFIG_HOME:-$HOME/.config}/task/task-sync.rc" ] || touch "${XDG_CONFIG_HOME:-$HOME/.config}/task/task-sync.rc"

View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
[ -d "$XDG_DATA_HOME/task/notes" ] || mkdir -p "$XDG_DATA_HOME/task/notes"

View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
export TIMEWARRIORDB="$XDG_CONFIG_HOME/timewarrior"