View previous topic :: View next topic |
Author |
Message |
ranger719 Tux's lil' helper
Joined: 16 May 2006 Posts: 92 Location: Germany
|
Posted: Tue Sep 04, 2007 5:19 pm Post subject: How to query users time of inactivity? |
|
|
Hi all,
I want to read my users idle time to do some time-based stuff after a certain amount of inactivity. I did not find a way to do this. I know that I can check /proc/diskstats to see if a drive was active (compare with earlier output). Is there a similar way to see if an input device was used (mouse/keyboard, both usb)? /dev/input/mice for example is not suitable, is it? Is there a simple tool? I searched google and this forum but nothing useful showed up. It would be great if someone knows a simple programm/way. A dcop call would be great, too.
Cheers |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Tue Sep 04, 2007 6:30 pm Post subject: |
|
|
Well, do you want to know the user's overall idle time for a given process, or do you actually need to know the last time they touched a device? For the former, the 'w' and 'who' commands can give you that (although it doesn't work for all processes). For the latter, I'm not sure how to check on that. _________________ Thomas S. Howard |
|
Back to top |
|
|
ranger719 Tux's lil' helper
Joined: 16 May 2006 Posts: 92 Location: Germany
|
Posted: Wed Sep 05, 2007 7:55 am Post subject: |
|
|
I want to do it like a screensaver
I want to know when the user last hit a key or moved the mouse. w and who do not provide this information. AFAIK w or who printed out the idle time of the users, but I don't see how to do it. This feature seems to be gone. I checked both man-pages.. |
|
Back to top |
|
|
.yankee Apprentice
Joined: 24 Feb 2008 Posts: 194 Location: Polska
|
Posted: Fri Jun 26, 2009 4:58 pm Post subject: |
|
|
Hi there!
I know it's a bit old topic now, but since I've just been looking into the same problem, I decided to resurrect it
Anyway - what might help, is /proc/interrupts - for instance, grepping it for i8042 in a loop should provide feedback on whether the keyboard or mouse were recently used . The problem remains to learn which user actually triggered the interrupts.
Maybe there's something more useful in /sys?
Anyone has better ideas? |
|
Back to top |
|
|
|