LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   last time user used mouse or keyboard? (https://www.linuxquestions.org/questions/linux-desktop-74/last-time-user-used-mouse-or-keyboard-839544/)

okie.floyd 10-21-2010 08:27 AM

last time user used mouse or keyboard?
 
i need to write a script that will tell me how long it has been since the user used the mouse or the keyboard.

basically, it would be nice to know where Linux keeps its timer for activating the screensaver. i know you can set the values via xset, but i need to be able to query the system and know how long it's been since there was a GUI event caused by user input.

anyone know where i can find this information?

thanks

okie

okie.floyd 10-21-2010 02:04 PM

this may be a lot more difficult than i thought, which is kinda sad.

after looking a little bit at the xscreensaver code, it looks like they are just checking each of the windows in X and keeping track of the mouse movement. basically just polling X with Xt calls.

if there is anything i want to stay away from, it is dealing with Xt crap. been there, done that.

was hoping there would be something i could cat out. /proc/interrupts doesn't help if you don't have the right connections (basically, USB connections make it useless).

no other clues?


All times are GMT -5. The time now is 05:52 PM.