View on-add.project_pwd.py
#!/usr/bin/env python | |
import json | |
import os | |
import sys | |
t = json.loads(sys.stdin.readline()) | |
if not 'project' in t: | |
t['project'] = os.path.basename(os.getcwd()) |
View on-add_interactivity.py
#!/usr/bin/env python | |
# | |
# PoC: Interactive on-add hook | |
import json | |
import sys | |
t = json.loads(sys.stdin.readline()) | |
real_stdin = open("/dev/tty", "r") |
View on-modify_macro_expand.py
#!/usr/bin/env python | |
# Proof of Concept for expanding aliases in annotations. | |
# | |
# See https://bug.tasktools.org/browse/TW-77 | |
import json | |
import re | |
import sys | |
old = json.loads(sys.stdin.readline()) | |
new = json.loads(sys.stdin.readline()) |
View datefilter.py
#!/usr/bin/env python | |
import re | |
import sys | |
import time | |
if len(sys.argv) < 2: | |
print "Example usage:" | |
print sys.argv[0], "2013-05-05 < ~/.task/completed.data > ~/.task/completed.data.tmp && mv ~/.task/completed.data.tmp ~/.task/completed.data" | |
sys.exit(1) |
View filter.py
#!/usr/bin/env python | |
import re | |
import sys | |
import time | |
if len(sys.argv) < 3 or sys.argv[2] not in ["all", "completed", "deleted"]: | |
sys.stderr.write("Reads data in Taskwarrior format from STDIN and writes to STDOUT only those tasks completed/deleted after the supplied date.\n\n") | |
sys.stderr.write("### Usage: " + sys.argv[0] + " <Y-m-d> <all|completed|deleted>\n") | |
sys.stderr.write("Where \"all\" filters all tasks and \"completed\"/\"deleted\" only those with the status set to the keyword specified.\n\n") | |
sys.stderr.write("### Example usage:\n") |
View taskwarrior_xmpp_bot.py
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sleekxmpp | |
import subprocess | |
import time | |
class TWBot(sleekxmpp.ClientXMPP): | |
def __init__(self, jid, password, whitelist): |
View on-launch_stopstarted.sh
#!/usr/bin/env bash | |
# Stops all previously active tasks on "task FILTER start" | |
# | |
# Only pending tasks are checked/stopped. If you really want to stop | |
# started tasks that are completed/deleted, remove the status:pending | |
# filter. Note that this will decrease performance, and should not | |
# be necessary. | |
tw_command="" | |
for i in "$@"; do |
View on-add_annotate.py
#!/usr/bin/env python3 | |
# | |
# Save as on-add_annotate.py in hooks directory, then: | |
# $ chmod +x ~/.task/hooks/on-add_annotate.py | |
# | |
# Anything after "annotate:" in a new task's description is added as an | |
# annotation: | |
# $ task add this is the description annotate:this is an annotation | |
import json |
View on-modify.timetrack.py
#!/usr/bin/env python | |
# | |
# Writes task start/stop times to a timelog formatted file. | |
# You might need to adjust LEDGERFILE, or set the TIMELOG environment variable. | |
# | |
# Example reports, after using start/stop on a task: | |
# ledger -f /path/to/timelog.ledger print | |
# ledger -f /path/to/timelog.ledger register | |
# | |
# Projects, tags, and UUIDs are fully supported and queryable from ledger. |
OlderNewer