From: martin f. krafft Date: Thu, 31 Jan 2019 01:57:35 +0000 (+1300) Subject: Add '.config/taskwarrior/taskpirate/' from commit 'c0d91dae27c2a1f73ed9fc103f7fbfcfc3... X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/a1b88a4611f98012432130e7d9ff6c5ed32b9eae?hp=c0d91dae27c2a1f73ed9fc103f7fbfcfc3ca0ae9 Add '.config/taskwarrior/taskpirate/' from commit 'c0d91dae27c2a1f73ed9fc103f7fbfcfc3ca0ae9' git-subtree-dir: .config/taskwarrior/taskpirate git-subtree-mainline: 9aa8aa5122d0208fd4177f436e9b60ab868e204c git-subtree-split: c0d91dae27c2a1f73ed9fc103f7fbfcfc3ca0ae9 --- diff --git a/.bin/task_attach b/.bin/task_attach new file mode 100755 index 0000000..efcbf4b --- /dev/null +++ b/.bin/task_attach @@ -0,0 +1,41 @@ +#!/bin/sh +set -eu + +if [ $# != 2 ]; then + echo >&2 E: Need exactly two arguments. + return 1 +fi + +TSK="$1" +LINK="$2" + +case "$LINK" in + (*@*|"<*>") + LINK="${LINK%>}"; LINK="%{LINK#<}" + echo >&2 I: "Adding MsgID <$LINK> to task $TSK" + task "$TSK" mod data:msgid:"$LINK" + ;; + + (*://*) + echo >&2 I: "Adding URL $LINK to task $TSK" + task "$TSK" mod data:url:"$LINK" + ;; + + (*) + if [ -f "$LINK" ]; then + + LINK="$(readlink -e "$LINK")" + + case "$LINK" in + ($HOME/*) LINK="~${LINK#$HOME}";; + esac + echo >&2 I: "Adding file $LINK to task $TSK" + task "$TSK" mod data:file:"$LINK" + + else + echo >&2 E: "Don't know how to handle link data $LINK" + return 1 + + fi + ;; +esac diff --git a/.bin/task_call b/.bin/task_call new file mode 100755 index 0000000..9f43a67 --- /dev/null +++ b/.bin/task_call @@ -0,0 +1,42 @@ +#!/bin/sh +set -eu + +if [ $# != 1 ]; then + echo >&2 E: Need exactly one argument. + return 1 +fi + +TSK="$1" + +DATA="$(task _get "$TSK".data)" +DATATYPE="${DATA%%:*}" +DATAPAYL="${DATA#*:}" + +case "$DATATYPE" in + ('') + echo >&2 I: No link data available for this task. + task "$TSK" + ;; + + (msgid) + mutt -f =store -e "push '~i $DATAPAYL'" + ;; + + (url) + sensible-browser "$DATAPAYL" + ;; + + (file) + if eval test -f "$DATAPAYL"; then + case "$(file --mime-type "$DATAPAYL")" in + (*": text/"*) eval sensible-editor "$DATAPAYL";; + (*) eval run-mailcap --action=edit "$DATAPAYL";; + esac + fi + ;; + + (*) + eval run-mailcap --action=edit "$DATAPAYL" + ;; + +esac diff --git a/.config/taskwarrior/.gitignore b/.config/taskwarrior/.gitignore new file mode 100644 index 0000000..645470a --- /dev/null +++ b/.config/taskwarrior/.gitignore @@ -0,0 +1,2 @@ +- /*.pem +- /taskd-credentials.rc diff --git a/.config/taskwarrior/rc b/.config/taskwarrior/rc new file mode 100644 index 0000000..0003703 --- /dev/null +++ b/.config/taskwarrior/rc @@ -0,0 +1,25 @@ +include /usr/share/taskwarrior/light-256.theme +data.location=~/.var/taskwarrior + +nag= +recurrence.indicator=@ +recurrence=off +hyphenate=off + +color.tag.TEMPLATE=gray16 on white +color.alternate= + +include /usr/share/taskwarrior/holidays.de-DE.rc +include /usr/share/taskwarrior/holidays.en-NZ.rc + +include ~/.config/taskwarrior/taskd-credentials.rc + +uda.data.type=string +uda.data.label=Ext.data +uda.data.indicator=→ + +report.next.columns=id,data.indicator,start.age,entry.age,depends,priority,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description,urgency +report.next.labels=ID,X,Active,Age,Deps,P,Project,Tag,Recur,S,Due,Until,Description,Urg + +alias.call=execute task_call +alias.attach=execute task_attach diff --git a/LICENCE b/.config/taskwarrior/taskpirate/LICENCE similarity index 100% rename from LICENCE rename to .config/taskwarrior/taskpirate/LICENCE diff --git a/README.md b/.config/taskwarrior/taskpirate/README.md similarity index 100% rename from README.md rename to .config/taskwarrior/taskpirate/README.md diff --git a/on-add-pirate b/.config/taskwarrior/taskpirate/on-add-pirate similarity index 100% rename from on-add-pirate rename to .config/taskwarrior/taskpirate/on-add-pirate diff --git a/on-modify-pirate b/.config/taskwarrior/taskpirate/on-modify-pirate similarity index 100% rename from on-modify-pirate rename to .config/taskwarrior/taskpirate/on-modify-pirate diff --git a/.crontab.d/taskwarrior b/.crontab.d/taskwarrior new file mode 100644 index 0000000..d26dae7 --- /dev/null +++ b/.crontab.d/taskwarrior @@ -0,0 +1 @@ +*/30 * * * * ( task sync && task next && task sync ) >/dev/null 2>&1 diff --git a/.gitignore.d/taskwarrior b/.gitignore.d/taskwarrior new file mode 100644 index 0000000..821a050 --- /dev/null +++ b/.gitignore.d/taskwarrior @@ -0,0 +1,11 @@ +* +!/.bin/task_attach +!/.bin/task_call +!/.config/taskwarrior/.gitignore +!/.config/taskwarrior/rc +!/.crontab.d/taskwarrior +!/.gitignore.d/taskwarrior +!/.taskrc +!/.var/taskwarrior/.gitignore +!/.var/taskwarrior/hooks +!/.zsh/zshrc/parts.d/50-taskwarrior diff --git a/.taskrc b/.taskrc new file mode 120000 index 0000000..3113449 --- /dev/null +++ b/.taskrc @@ -0,0 +1 @@ +.config/taskwarrior/rc \ No newline at end of file diff --git a/.var/taskwarrior/.gitignore b/.var/taskwarrior/.gitignore new file mode 100644 index 0000000..216f0fe --- /dev/null +++ b/.var/taskwarrior/.gitignore @@ -0,0 +1 @@ +- /*.data diff --git a/.var/taskwarrior/hooks b/.var/taskwarrior/hooks new file mode 120000 index 0000000..729b1ca --- /dev/null +++ b/.var/taskwarrior/hooks @@ -0,0 +1 @@ +../../.config/taskwarrior/hooks \ No newline at end of file diff --git a/.zsh/zshrc/parts.d/50-taskwarrior b/.zsh/zshrc/parts.d/50-taskwarrior new file mode 100644 index 0000000..51d993f --- /dev/null +++ b/.zsh/zshrc/parts.d/50-taskwarrior @@ -0,0 +1,32 @@ +# +# taskwarrior shell integration +# +# 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 +# + +if whence task >/dev/null; then + + 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' + + run_at_most_every 5m \ + t 2>/dev/null || : +fi + +# vim:ft=zsh