taskwarrior

From Gentoo Wiki
Jump to:navigation Jump to:search

This article is a stub. Please help out by expanding it - how to get started.

Taskwarrior (task) is a to-do list manager for the command line written in C++. It uses a simple human readable text file format to store to-do list items and associated metadata. Taskwarrior isn't tied to a specific school of thought on task organization. It's designed to be simple yet flexible and scalable. As such, Taskwarrior has a syntax that is simple and intuitive.

Notable features include:

  • Data is stored locally in JSON files, easing migration to and from Taskwarror.
  • Interactions can be scripted via Taskwarrior's Hooks API.
  • Multiple UI options are available as part of the Taskwarrior ecosystem.
  • When paired with app-misc/taskd, tasks can be shared with multiple remote client applications.

Installation

Emerge

root #emerge --ask app-misc/task

Configuration

Environment variables

  • $TASKRC allows the user to relocate the .taskrc configuration file to a desired directory.
  • $TASKDATA allows the user to relocate the .task data file to a desired directory.

Modifying these variables is not required to enforce XDG Base Directory Support. If you've installed task warrior and it's ignoring you XDG preferences see the troubleshooting section.

Files

  • ~/.config/task/taskrc — XDG local (per user) configuration file.
  • ~/.local/share/task/* — XDG task list directory with tasks spread across multiple files.
  • ~/.taskrc — legacy local (per user) configuration file.
  • ~/.task/* — legacy local (per user) task list directory with tasks spread across multiple files.

Service

By itself, Taskwarrior is a single device application allowing all users on the device to have their own personal tasks lists. However, the Taskserver daemon provides a backend task server which provides for multiuser and multiclient support. Some smartphone applications, notably Foreground for Android, have begun to support this.

Usage

Basic usage is fairly intuitive, to list your exiting to-do items:

user $task
ID Age  Project         Tag       Due      Description                                Urg 
¯¯ ¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯     ¯¯¯¯¯¯    ¯¯¯¯¯¯   ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
1  2w   gentoo-wiki               ~1mo     Add basic usage to ledger article          2.6
2  1w   friends                    5d      Buy sam_ and ris a beer                    1.4
3  3d   home                               Clean out the garage.                      0.2

To add a new task, simply type task add <task description> setting a due date and a project are optional but common for task organization purposes. Due dates do not necessarily require exact numeric dates. Taskwarrior has several human readable aliases such as eom for "end of month" and days of the week from which Taskwarrior can work out the date.

user $task add Pay the utility bills due:eom project:home

To complete a task you need to reference its task number:

user $task 1 done

Task completion and task deletion aren't the same thing. In the former case, the task is moved a "completed" state but a record of it remains. If a task is deleted it is removed from the database. To delete an erroneously created task:

user $task 3 del

To generate a simple report for all tasks associated with a specific project task project:<project name> list. So, if you have an existing project called home and you want a list of all the associated tasks the command and its output should look something like this:

user $task project:home list
ID Age  Project     Tag       Due          Description                                Urg 
¯¯ ¯¯¯  ¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯    ¯¯¯¯¯¯¯¯¯¯   ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
3  3d   home                               Clean out the garage                       0.2
4  1h   home                  2023-04-30   Pay the utility bills                      0.1

Taskwarrior has many features burred below the surface. Numerous potential workflows are supported. The official Taskwarrior documentation is full of detail rich examples on how to get the most out of it.

Invocation

user $task help

Tips

This sections lists useful command that may not be obvious to find:

  • List completed tasks for a project:
    user $task completed project:test
  • Replace a description with spaces:
    user $task 145 mod "/A Test/Not a test/"

Troubleshooting

Taskwarrior is not respecting the XDG Base Directory Specification

Taskwarrior defaults to ~/.taskrc. If ~/.taskrc is missing but ~./config/task/taskrc is present, the latter will be used. If both files are present, ~/.taskrc takes precedence. Thus, the file should first be moved, not just copied:

user $mkdir ~./config/task/
user $mv ~/.taskrc ~./config/task/taskrc

Next, edit ~./config/task/taskrc and uncomment the following lines:

FILE ~./config/task/taskrcdefault .taskrc configuration
#data.location=~/.local/share/task
#hooks.location=~/.config/task/hooks

Next, move your existing ~/.task/ directory:

user $mkdir ~/.local/share/task/
user $cp -r ~/.task/* ~/.local/share/task/

Confirm the contents of the ~/.task directory have been copied properly and then delete the original directory.

user $rm -rf ~/.task/

Next, copy the contents of ~/.task/hooks/ to the ~/.config/task/hooks/ directory:

user $cp -r ~/.task/hooks/* ~/.config/task/hooks/

Finally, delete ~/.local/share/task/hooks/ if present and the original ~/.task directory:

user $rm -rf ~/.local/share/task/hooks/
user $rm -rf ~/.task

Removal

Unmerge

root #emerge --ask --depclean --verbose app-misc/task

See Also