views:

77

answers:

1

Is there a GetLastInputInfo() equivalent that can be used in Linux?

The intention is to detect the last input time (keyboard or mouse) of the user. Am using python to script the program.

+1  A: 

XScreenSaverQueryInfo

The idle field specifies the number of milliseconds since the last input was received from the user on any of the input devices. The event-mask field specifies which, if any, screen saver events this client has requested using ScreenSaverSelectInput.

wRAR
Is that always available?From what I've been reading, the XScreenSaver framework isn't installed by default, depending on which Linux distro you're talking about. According to "info xscreensaver" both Gnome and KDE have competing screen-saver frameworks.
Die in Sente
It is `libXScrnSaver`, not "the XScreenSaver framework".
wRAR