1

I have been using Taskwarrior primarily to track books I read and I want to read (for some years now, actually), so projects are based on book genres and customised fields are also related to books in general.

The Taskwarrior documentation simply states the program creates the .taskrc file with the tasks and configurations inside the .task folder. I was wondering: is it possible to set a new task file in another location outside home and specify Taskwarrior to read it in my command line call, so I don't have to mix my two lists?

manoelpqueiroz
  • 351
  • 2
  • 8

1 Answers1

1

You can do that by setting the TASKDATA environment variable when running the task command. Adding a task to a test environment:

➜  ~ TASKDATA=~/test task add test1    
TASKDATA override: /home/tom/test
Created task 1.

Adding a task to your normal environment:

➜  ~ TASKDATA=~/.task task add test1
TASKDATA override: /home/tom/.task
Created task 354.

However I don't think you should use taskwarrior like this. Taskwarrior supports filtering your tasks using contexts. This makes it possible to filter your tasks based on tags and projects of the tasks, which sounds like what you want to do. You could add the following to your .taskrc to create the context fiction:

context.fiction+=+fiction or pro:fiction.

Now if you execute task context fiction, only the tasks that have the fiction tag or are assigned to the project fiction are displayed when you run task.

Tom Dörr
  • 181
  • 1
  • 5