I’m a fan of tracking everything especially if tracking it comes at zero cost. That’s why I used ActivityWatch for a long time on Windows. ActivityWatch is a great and very user-friendly open source project. Unfortunately I only got it working very inconsistently on Linux which is obviously a big pain when trying to track your behavior over a longer period of time. It also used more resources and was less hackable than I would have liked. So I decided to give up on ActivityWatch and replace it with this small shell script (to be fair ActivityWatch adds more than that: It also has great browser integration, a localhost web interface and so on).
To start the daemon, my PC runs this command on every startup (the -m
flag only specifies how much time can pass without making a database entry - it defaults to eight):
ticktack start -m 30
To check how long I’ve been focusing the emacs window on the current day, I would do:
ticktack query --begin "$(date -d 'today 00:00:00' '+%s')" --sum class
To check how long I’ve been on my PC yesterday, I would do:
ticktack query --begin "$(date -d 'yesterday 00:00:00' +'%s')" --end "$(date -d 'today 00:00:00' '+%s')" --sum all
You get the idea. Querying features are currently a little limited but sufficient and very simple. The only database is located at $XDG_DATA_HOME/ticktack.db
.