Timewarrior

From wikinotes

Extension for taskwarrior that logs duration of tasks.

Config

taskwarrior integration

A script is provided so that switching jobs in taskwarrior triggers new timewarrior events.

ln -s /usr/share/doc/timew/ext ~/.task_pers/hooks/on-modify.timewarrior

scheduling

work-week

You can carve out what your working hours look like with exclusions set on days of the week. The idea is that you are defining ranges to be excluded. Multiple ranges can be defined for a single day.

example config:

timew config exclusions.monday    '<6:30 >15:00'
timew config exclusions.tuesday   '<6:30 >15:00'
timew config exclusions.wednesday '<6:30 >15:00'
...

The documentation is very vague on how this actually works, but from trial/error this is how I understand it:

  • every exclusion is marked by a pair of time-delimeters (time,<,>)
  • ranges between times are separated by -
  • no character separates < or > and a time, and the arrow is ALWAYS first.
  • < excludes all time BEFORE the following time
  • > excludes all time AFTER the following time

examples:

## '''<''' indicates all time 

## 2x dates in succession marks an excluded range
12:30-13:15

'>9:00'                         ## exclude all time AFTER 9:00
'<9:00'                         ## exclude all time BEFORE 9:00
'<9:00   >18:00'                ## exclude time BEFORE 9:00  and AFTER 18:00
'<9:00   12:00-15:00   >18:00'  ## time BEFORE 9:00, time BETWEEN 12:00-15:00, time AFTER 18:00

holidays

The TimeWarrior holiday files are generated automatically using http://holidata.net. You'll need to generate holidays for your locale.

create holidays file

./usr/share/doc/timew/doc/holidays/refresh --locale en-CA

update holidays file every year at Christmas

# crontab -e
0 20 25 12 *  /usr/share/doc/timew/doc/holidays/refresh --locale en-CA

use holidays file to exclude holidays

# ~/.timewarrior/timewarrior.cfg
import /usr/share/doc/timew/doc/holidays/holidays.en-US

schedule exceptions

timew config   exclusions.days.2016_09_22    on/off  :yes  ## make Sept22,2016 available/unavailable to schedule time

Commands

recording

timew start      ## start recording time
timew stop       ## stop recording time
timew continue   ## continue the last active `tag`

reports

timew summary         [<tag>,<tag>,...]   ## show summary of recorded time
timew day/week/month  [<tag>,<tag>,...]   ## print a GANT chart of time spent

modifying history

## detailed information about accepted date-formats/interval-formats
timew help date
timew help interval
timew  gaps                                      ## display any empty spots in scheduled time

timew  track 9am - 11am       'helping pascal'   ## log a fixed time period for a task
timew  track 2h before 11am   'documentation'
timew  track 9am for 2h       'planning'

timew  start monday 'research'                   ## fill all scheduled available-time between monday and now
                                                  # with the tag `research`