Last active
August 17, 2024 01:56
Demo of TaskWarrior (`task`)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# # A demo/test of taskwarrior (`task`) | |
# | |
# ## Usage | |
# ```sh | |
# ./test_demo_taskw.sh | |
# ``` | |
# Note: Interactive input is required: | |
# - [read and] type "yes" or "y" | |
# - [read and] type "all" to indeed delete all tasks without further prompting | |
# | |
# ## TaskWarrior | |
# - Wikipedia: https://en.wikipedia.org/wiki/Taskwarrior | |
# - Source: https://github.com/GothenburgBitFactory/taskwarrior | |
# - Docs: https://taskwarrior.org/docs/ | |
set -x | |
# task help | |
task; task list | |
task add "Read the source due:today priority:H project:projectA" # 1 | |
task add Read the docs later due:tomorrow priority:M project:projectA # 2 | |
task add project:one task abc # 3 | |
task add project:one task def +someday depends:3 # 4 | |
task | |
task 1; task 2; | |
task context define projectA "project:projectA or +urgent" # prompts for 'y' | |
task context list | |
task context projectA | |
task add task ghi # 5 | |
task add task jkl +someday depends:3 # 6 | |
task # lists just tasks for the current context:"project:projectA" | |
task next | |
task 1 done | |
task next | |
task 2 start | |
task 2 done | |
task context none | |
task delete # prompts for y/yes//all before deleting *ALL* tasks interactively | |
task | |
task context list | |
taskw_context_delete() { | |
## taskw_context_rm -- TASKRC=$HOME/.taskrc; (sed -i '/^context\..*\.read=/d' "${TASKRC}" && \ | |
# sed -i '/^context\..*\.write=/d' "${TASKRC}") | |
contextname=$1 | |
TASKRC="${TASKRC:-"$HOME/.taskrc"}" | |
if [ -z "${contextname}" ]; then | |
sed -i '/^context\..*\.read=/d' "${TASKRC}" | |
sed -i '/^context\..*\.write=/d' "${TASKRC}" | |
else | |
sed -i "/^context\.${contextname}\.read=/d" "${TASKRC}" | |
sed -i "/^context\.${contextname}\.write=/d" "${TASKRC}" | |
fi | |
} | |
taskw_context_delete projectA | |
taskw_context_delete | |
alias t=task |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ctrl-minus
(Ctrl+-
)!
to run them with$SHELL
instead of python;!bash -c "set -x; echo hello world"