On Sep 29, 7:36 pm, Hugo Léveillé <hu...@fastmail.net> wrote:
> Good point
>
> One I am looking for, is time since last user mouse or keyboard action.
> So I guess I am looking for the exact same thing a screensaver is
> looking for

The command

who -Hu).


will give you idle time for each logged-in user

( H - print headers; u - list users )

and you could run this command via subprocess, then read and parse its
output.

Alternatively you could parse the same file(s) as who - I think it
reads /var/run/utmp - but that would be a lot more work, as it is a
binary file (run man utmp to see its format, use the struct module to
decode)

Best wishes,

John
--


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to