Time tracking by screenshot

As an experiment, I’ve set up my laptop to record screenshots every minute. My hope is that I can write a program that will automatically figure out how much time I am spending on various tasks by teaching the program what certain tasks looks like. I think my first approach will be to classify based on colour levels.

In case anyone finds this sort of thing useful, here’s the script I’m using (on Ubuntu 11.10):

#!/usr/bin/env bash
# take_screenshot.sh
# Does the following (optional steps in parens):
# * ( Install dependencies )
# * ( Set up hidden .desktop_tracking folder )
# * Take a screenshot and resize it
if [ ! -d $HOME/.desktop_tracking ];
then
  mkdir $HOME/.desktop_tracking
fi
which import > /dev/null
success=$?
if [ $success == 1 ];
then
  sudo apt-get install -y imagemagick
fi
export DISPLAY=':0.0'
import -window root -resize 750 $HOME/.desktop_tracking/`date +%F-%H_%M_%S`.png