I also tried running this little C program below to print the X server idle time. I was curious if the idle time was increasing even though I was typing.
It's odd, but the idle time appears to be staying quite low:
$ while : ; do echo "$(date) : $(./xprintidle)"; sleep 10 ; done
...
Thu Feb 7 13:28:59 CST 2013 : 1310
Thu Feb 7 13:29:09 CST 2013 : 7
Thu Feb 7 13:29:19 CST 2013 : 6711
Thu Feb 7 13:29:29 CST 2013 : 911
...
The screensaver kicked in at 13:29:08 even though the idle time was no more than 11.3 seconds, and my xscreensaver timeout is at 60 seconds (normally it's 5 minutes, but I reduced it to 1 minute for debugging).
I also tried running this little C program below to print the X server idle time. I was curious if the idle time was increasing even though I was typing.
It's odd, but the idle time appears to be staying quite low:
$ while : ; do echo "$(date) : $(./xprintidle)"; sleep 10 ; done
...
Thu Feb 7 13:28:59 CST 2013 : 1310
Thu Feb 7 13:29:09 CST 2013 : 7
Thu Feb 7 13:29:19 CST 2013 : 6711
Thu Feb 7 13:29:29 CST 2013 : 911
...
The screensaver kicked in at 13:29:08 even though the idle time was no more than 11.3 seconds, and my xscreensaver timeout is at 60 seconds (normally it's 5 minutes, but I reduced it to 1 minute for debugging).
http:// stackoverflow. com/questions/ 11887679/ how-does- x11-xscreensave r-know- how-long- ive-been- idle-xprintidle -unhelpful
~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~ /scrnsaver. h>
#include <X11/extensions
#include <stdio.h>
int main() { verInfo *info = XScreenSaverAll ocInfo( ); verQueryInfo( display, DefaultRootWind ow(display) , info);
printf( "%lu\n" , info->idle);
XFree( info); ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~
Display *display = XOpenDisplay(0);
if (display != 0) {
XScreenSa
XScreenSa
if (info)
{
return 0;
}
return -1;
}
return -1;
}
~~~~~~~