Using Xlib to measure productivity (aka time&keypresses spent on a window)

Tomasz Torcz tomek at
Sat Mar 6 03:11:36 PST 2010

On Sat, Mar 06, 2010 at 06:22:29PM +1100, Yose Widjaja wrote:
> Hi All,
> Is this possible using Xlib? I'm trying to implement something like
> RescueTime, an app to measure productivity, but for linux. The main purpose
> of this is to measure how much time (and keypresses and clicks) I spend in
> xterm and nedit compared to firefox..
> So is it possible to 1) get the actual binary name behind a window, 2)
> intercept keypresses/mouse movements and re-relay them? Any info will be
> much appreciated.

  You could try to find som esource of Mugshot application by Red Hat.
It was collecting information like that and making statistics of most
used applications. IIRC, it was using libwnck to do the X11 part.

Tomasz Torcz                 "God, root, what's the difference?"
xmpp: zdzichubg at         "God is more forgiving."

More information about the xorg mailing list