I am trying to write a Java program that logs what application I\'m using every 5 seconds (this is a time tracker app). I need some way to find out what the current active w
I've written a bash script that logs the current active window: http://www.whitelamp.com/public/active-window-logger.html It uses a patched version of wmctrl but provides details of an alternative (slower) method using xprop and xwininfo.
The links to the wmctrl patch & source code and the script can be found above.