On Mon, Feb 04, 2002, Schlomo Schapiro wrote about "Re: how to find out wether X user 
is idle":
> What about offering some new ideas instead of just stating the obvious and
> unfeasable (I don't have time to dive into large sources now) ?

What Guy suggested is neither obvious nor unfeasable. All you need to do
is to take a look at the source of some automatic screen saver, and find
out how the "screen saver extension" is used.

> Btw: Using xautolock to run a program after x minutes idle time is not
> enough because I need a per-minute sample wether the user is active or not
> to be able to create true usage profiles. And I need to know also (end
> especially) about extended periods of inactivity.

Another option is to write a tiny xlib program which gets copies of events
you're interested in (e.g., keyboard presses, mouse clicks, window creations)
and then you can estimate inactivity (e.g., 10 minutes without any of these
events happening is probably a coffee break). Doing this is not unfeasable
either (shouldn't take more than a few hours if you know XLib programming),
But whether it's worth your trouble is up to you.

Of course, the value of all this depends on how important it is for your
users to deceive your checking program. For example, if you want to deduct
pay from someone who took a break longer than 15 minutes, be sure that
one of your users will invent a method to mess with your program (e.g., the
old "book over the numeric keypad" trick, or using fake events). If you
use my event capturing idea, you can fight back: ignore send_event events
(see XEvent(3)), ignore repeating of the same key, and so on.

-- 
Nadav Har'El                        |      Monday, Feb  4 2002, 22 Shevat 5762
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |Ms Piggy's last words: "I'm pink,
http://nadav.harel.org.il           |therefore I'm ham."

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to