]> git.madduck.net Git - etc/taskwarrior.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add '.config/taskwarrior/taskpirate/' from commit 'c0d91dae27c2a1f73ed9fc103f7fbfcfc3...
authormartin f. krafft <madduck@madduck.net>
Thu, 31 Jan 2019 01:57:35 +0000 (14:57 +1300)
committermartin f. krafft <madduck@madduck.net>
Thu, 31 Jan 2019 01:57:35 +0000 (14:57 +1300)
git-subtree-dir: .config/taskwarrior/taskpirate
git-subtree-mainline: 9aa8aa5122d0208fd4177f436e9b60ab868e204c
git-subtree-split: c0d91dae27c2a1f73ed9fc103f7fbfcfc3ca0ae9

14 files changed:
.bin/task_attach [new file with mode: 0755]
.bin/task_call [new file with mode: 0755]
.config/taskwarrior/.gitignore [new file with mode: 0644]
.config/taskwarrior/rc [new file with mode: 0644]
.config/taskwarrior/taskpirate/LICENCE [moved from LICENCE with 100% similarity]
.config/taskwarrior/taskpirate/README.md [moved from README.md with 100% similarity]
.config/taskwarrior/taskpirate/on-add-pirate [moved from on-add-pirate with 100% similarity]
.config/taskwarrior/taskpirate/on-modify-pirate [moved from on-modify-pirate with 100% similarity]
.crontab.d/taskwarrior [new file with mode: 0644]
.gitignore.d/taskwarrior [new file with mode: 0644]
.taskrc [new symlink]
.var/taskwarrior/.gitignore [new file with mode: 0644]
.var/taskwarrior/hooks [new symlink]
.zsh/zshrc/parts.d/50-taskwarrior [new file with mode: 0644]

diff --git a/.bin/task_attach b/.bin/task_attach
new file mode 100755 (executable)
index 0000000..efcbf4b
--- /dev/null
@@ -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 (executable)
index 0000000..9f43a67
--- /dev/null
@@ -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 '<search>~i $DATAPAYL'<enter>"
+    ;;
+
+  (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 (file)
index 0000000..645470a
--- /dev/null
@@ -0,0 +1,2 @@
+- /*.pem
+- /taskd-credentials.rc
diff --git a/.config/taskwarrior/rc b/.config/taskwarrior/rc
new file mode 100644 (file)
index 0000000..0003703
--- /dev/null
@@ -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/.crontab.d/taskwarrior b/.crontab.d/taskwarrior
new file mode 100644 (file)
index 0000000..d26dae7
--- /dev/null
@@ -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 (file)
index 0000000..821a050
--- /dev/null
@@ -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 (symlink)
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 (file)
index 0000000..216f0fe
--- /dev/null
@@ -0,0 +1 @@
+- /*.data
diff --git a/.var/taskwarrior/hooks b/.var/taskwarrior/hooks
new file mode 120000 (symlink)
index 0000000..729b1ca
--- /dev/null
@@ -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 (file)
index 0000000..51d993f
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# taskwarrior shell integration
+#
+# Copyright © 2018 martin f. krafft <madduck@madduck.net>
+# 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