8

Get a different X Display Idle time - C code

view full story
linux-howto

http://stackoverflow.com – I have found quite a few C fragments on this topic. I modified and was able to get my X display idle time: #include <stdio.h> #include <X11/Xlib.h> #include <X11/extensions/scrnsaver.h> /* Report amount of X server idle time. */ /* Build with- */ /* cc xidle.c -o xidle -lX11 -lXext -lXss */ int main(int argc, char *argv[]) { Display *display; int event_base, error_base; XScreenSaverInfo info; unsigned int seconds; display = XOpenDisplay(""); if(display) { if (XScreenSaverQueryExtension(display, &event_ (HowTos)