diff options
| -rw-r--r-- | py3status/modules/taskwarrior.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/py3status/modules/taskwarrior.py b/py3status/modules/taskwarrior.py index 75faa8f..65407e5 100644 --- a/py3status/modules/taskwarrior.py +++ b/py3status/modules/taskwarrior.py @@ -3,7 +3,7 @@ Display currently active (started) taskwarrior tasks. Configuration parameters: - - cache_timeout : how often we refresh this module in seconds + - cache_timeout : how often we refresh this module in seconds (5s default) Requires - task @@ -15,20 +15,23 @@ Requires # import your useful libs here from time import time from subprocess import check_output -import shlex import json +import shlex class Py3status: + """ + """ + # available configuration parameters cache_timeout = 5 def taskWarrior(self, i3s_output_list, i3s_config): - command = "task start.before:tomorrow status:pending export" + command = 'task start.before:tomorrow status:pending export' taskwarrior_output = check_output(shlex.split(command)) - tasks_json = json.loads("[" + taskwarrior_output + "]") + tasks_json = json.loads('[' + taskwarrior_output.decode('utf-8') + ']') def describeTask(taskObj): - return str(taskObj['id']) + " " + taskObj['description'] + return str(taskObj['id']) + ' ' + taskObj['description'] result = ', '.join(map(describeTask, tasks_json)) response = { |
