Nerd Snipe
Task time tracking

Created 2025-03-04 / Edited 2025-03-04

Since I'm going some consulting work I have to do a bit of time tracking. And you know what that means! Playing with my taskwarrior and timewarrior config!!!

stopwatch oil painting

openai: Generate an image of a stopwatch in the style of an impressionist oil painting with thick bold brush strokes

What would you say you do here?

It's pretty easy for me to focus on something but it takes effort to make sure that I'm focused on the right thing, don't forget stuff, and keep track of what it is that I did. I have been using taskwarrior for quite a while, I even have it integrated in with my gmail-starred emails which is handy.

But I also need to keep track of billable hours. There is a separate but corresponding timewarrior project for this, and a hook that ties them together. So once configured, if you do task 123 start it will start the clock for task 123, and if you do either task 123 stop or task 123 done then it will stop the clock. You can use timew reports to see the total time.

Start the clock immediately

Sometimes, often, I want to note a task and immediately begin working on it. I modified the on-modify.timewarrior to be a on-add.timewarrior and then add this alias into .taskrc:

alias.doing = add start:now

Only One Clock. Stop "it".

While there might be fancier ways to use timewarrior, how I'm using it basically assumes there is only one task happening at a time. If you task 123 stop then it stops the clock. If you task 456 start then it stops the old one (in timewarrior, not in taskwarrior) and starts the new one. Fine. But let's make a handy shorthand for stopping/finishing the "current" task.

Altogether, I now have this in my .taskrc:

# These use on-add.timewarrior and on-modify.timewarrior hooks

# Shortcuts to both add and start
alias.doing = add start:now

# Shortcuts to stop or complete the currently started
alias.stopit = start.not: stop
alias.doneit = start.not: done

Now I can task doing "working on something" and then either task stopit or task doneit!