I'm mostly immune to manual time-tracking tools. Since my primary computer has, inherently, enough information to figure out what I'm working on, it should capture that for me.
I did a little more hacking here - a simple python script to figure out what's the top window and log it, using subprocess.Popen to call xwininfo and xprop.
Since I was having some reliability issues with figuring out the "top window", I tried using ratpoison -c 'windows %s%i' but something about running that 3 times/second (or possibly about using c-c to interrupt it) crashed ratpoison (1.4.0-beta4 ubuntu) which I'll try and diagnose later.
In the meantime, a discussion about some of my old perl code (the fact that I still set my X desktop with code that uses my pure-perl Xlib implementation, http://www.foo.be/docs/tpj/issues/vol2_1/tpj0201-0010.html was pointed out as one of the last chunks of perl in my life, since my "conversion" to python) inspired me to look at python-xlib again. Turns out that python-xlib has a nicely rich interface (windows as objects with methods, rather than a thin mapping to the C bindings, while still being appropriately close to the wire.) python-xlib gave me a number of advantages:
The current version on_top.py still has a little debugging info, and only covers the logging and data-gathering parts of the effort. It doesn't cover actually mapping this information to what project I'm actually working on; I want to start out by collecting evidence, and after a few days of that will come back and figure out how to analyze it.
I've been sufficiently over-multi-tasked at work that it's time to put some effort into meta-project-tracking again.
I just noticed that xwininfo -stats -root -tree actually seems to list the windows in order, such that the first one mentioned is the top window, and since I use ratpoison, that's the one I'm looking at...