Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to query users time of inactivity?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ranger719
Tux's lil' helper
Tux's lil' helper


Joined: 16 May 2006
Posts: 92
Location: Germany

PostPosted: Tue Sep 04, 2007 5:19 pm    Post subject: How to query users time of inactivity? Reply with quote

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
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Tue Sep 04, 2007 6:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
ranger719
Tux's lil' helper
Tux's lil' helper


Joined: 16 May 2006
Posts: 92
Location: Germany

PostPosted: Wed Sep 05, 2007 7:55 am    Post subject: Reply with quote

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
View user's profile Send private message
.yankee
Apprentice
Apprentice


Joined: 24 Feb 2008
Posts: 194
Location: Polska

PostPosted: Fri Jun 26, 2009 4:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum