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:
parent
4b4afc68f3
commit
b534454a88
13 changed files with 18 additions and 22 deletions
32
office/.config/sh/alias.d/taskwarrior.sh
Normal file
32
office/.config/sh/alias.d/taskwarrior.sh
Normal 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"
|
||||
16
office/.config/sh/alias.d/timewarrior.sh
Normal file
16
office/.config/sh/alias.d/timewarrior.sh
Normal 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
|
||||
}
|
||||
6
office/.config/sh/env.d/taskwarrior-ensure-files.sh
Normal file
6
office/.config/sh/env.d/taskwarrior-ensure-files.sh
Normal 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"
|
||||
3
office/.config/sh/env.d/taskwarrior-xdg.sh
Normal file
3
office/.config/sh/env.d/taskwarrior-xdg.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
[ -d "$XDG_DATA_HOME/task/notes" ] || mkdir -p "$XDG_DATA_HOME/task/notes"
|
||||
3
office/.config/sh/env.d/timewarrior-xdg.sh
Normal file
3
office/.config/sh/env.d/timewarrior-xdg.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
export TIMEWARRIORDB="$XDG_CONFIG_HOME/timewarrior"
|
||||
Loading…
Add table
Add a link
Reference in a new issue