taskwarrior: Add contexts, Fix completions

Fixed the completions for the `t` alias that takes over task
functionality on the shell. Only works on zsh, and presumably not on
every system since it relies on some ps trickery to find out the
currently running shell. Maybe there's a better version out there
somewhere...

Added basic distinction into work/personal contexts, since, with my
current job having a complex enough task list I want that either not
cluttering up my enjoyable tasks, or *only* that cluttering up all my
tasks.
This commit is contained in:
Marty Oehme 2021-03-27 22:15:45 +01:00
parent d880893e21
commit e2b82b56f9
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 22 additions and 9 deletions

View file

@ -5,10 +5,15 @@ alias taskopen='taskopen -c ${XDG_DATA_HOME}/task/notes'
# invoking t starts the task shell # invoking t starts the task shell
# passing arguments along passes them straight through to taskwarrior instead # passing arguments along passes them straight through to taskwarrior instead
t() { t() {
# check for existence of tasksh before doing this whole song and dance # check for existence of tasksh before doing this whole song and dance
if type tasksh >/dev/null 2>&1 && [ "$#" -eq 0 ]; then if type tasksh >/dev/null 2>&1 && [ "$#" -eq 0 ]; then
tasksh tasksh
else else
task "$@" task "$@"
fi 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

View file

@ -54,9 +54,6 @@ urgency.annotations.coefficient=0
# maybe items are not urgent at all # maybe items are not urgent at all
urgency.user.tag.maybe.coefficient=-100.0 urgency.user.tag.maybe.coefficient=-100.0
# only ever show one result in the task shell
tasksh.autoclear=1
# temporary taskd configuration for freecinc (should be selfhosted at some point) # temporary taskd configuration for freecinc (should be selfhosted at some point)
taskd.server=freecinc.com:53589 taskd.server=freecinc.com:53589
taskd.key=~/.local/share/task/keys/freecinc_7ebc40a3.key.pem taskd.key=~/.local/share/task/keys/freecinc_7ebc40a3.key.pem
@ -79,10 +76,21 @@ taskd.credentials=FreeCinc\/freecinc_7ebc40a3\/1b2f5c1e-3d62-4a35-82c8-82ce0e237
#include /usr/share/doc/task/rc/solarized-dark-256.theme #include /usr/share/doc/task/rc/solarized-dark-256.theme
#include /usr/share/doc/task/rc/solarized-light-256.theme #include /usr/share/doc/task/rc/solarized-light-256.theme
#include /usr/share/doc/task/rc/no-color.theme #include /usr/share/doc/task/rc/no-color.theme
# try to fix some color weirdness, especially in tmux
color.scheduled=on grey color.scheduled=on grey
# only ever show one result in the tasksh
tasksh.autoclear=1
# for tasksh review sessions
uda.reviewed.type=date uda.reviewed.type=date
uda.reviewed.label=Reviewed uda.reviewed.label=Reviewed
report._reviewed.description=Tasksh review report. Adjust the filter to your needs. report._reviewed.description=Tasksh review report. Adjust the filter to your needs.
report._reviewed.columns=uuid report._reviewed.columns=uuid
report._reviewed.sort=reviewed+,modified+ report._reviewed.sort=reviewed+,modified+
report._reviewed.filter=( reviewed.none: or reviewed.before:now-6days ) and ( +PENDING or +WAITING ) report._reviewed.filter=( reviewed.none: or reviewed.before:now-6days ) and ( +PENDING or +WAITING )
# different life contexts
context.personal= project.hasnt:arbeit
context.arbeit= project:arbeit
context=personal