Time Tracking with arbtt

arbtt-capture is a cross-platform tool that logs metadata about your open windows in a consistent log format.

arbtt-stats is an analytis tool that can analyze your logs.

The arbtt website and documentation are probably the best places to learn how to get started.

Installing arbtt on MacOS with brew:

# Install dependencies (see: https://arbtt.nomeata.de/#install)
brew install pkgconfig
brew install pcre
brew install cabal-install

#Install arbtt
cabal update
cabal install arbtt


The launchagent plist is set up to set the application to start when the computer loads and then capture every 15 seconds:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Analyzing Untagged Data:

I use a handful of tags, so I can get my untagged data by explicitly avoiding those rows:

arbtt-stats --m=0 --filter='$sampleage <24:00' --dump-samples -x DevOps -x TimeTracking -x Programming -x Correspondence -x Recreation -x Analytics | fgrep '(*)'

System Modifications

I've made a few changes to improve the ability to track various programs. This basically means that I'm using various tricks to add additional information to the title of windows when possible.

I use the URL in title Firefox Add-on to track my browsing by url.

I made a slight modification to OSX to show the finder's full path in the title:

defaults write com.apple.finder _FXShowPosixPathInTitle -bool true; killall Finder

I also added the following to my bash profile to keep track off what I'm doing in the terminal:

trap 'echo -ne "\033]2;$(pwd); $(history 1 | sed "s/^[ ]*[0-9]*[ ]*//g")\007"' DEBUG

I also added some bash aliases to do common tasks.:

# Aliases for timetracking
alias tt="arbtt-stats --for-each=day --filter='\$sampleage <12:00'"
alias tta="arbtt-stats --m=0 --filter='\$sampleage <24:00' --dump-samples -x DevOps -x TimeTracking -x Programming -x Correspondence -x Recreation -x Analytics -x ProjectManagment -x Research | fgrep '(*)'"

I use tmux almost exclusively, so to keep the current command and path in its title to use.

# Include current command and path in title for arbtt
set-option -g set-titles on
set-option -g set-titles-string "#W - #{pane_current_path}"
set-option -g status-interval 1