12345678910111213141516171819202122232425262728 |
- #include <X11/extensions/scrnsaver.h>
- #include <stdio.h>
- main() {
- XScreenSaverInfo *info = XScreenSaverAllocInfo();
-
- Display *display = XOpenDisplay(0);
-
- if (info == NULL || display == NULL) {
- return -1;
- }
-
- if (XScreenSaverQueryInfo(display, DefaultRootWindow(display), info) == 0) {
- return -1;
- }
-
- printf("%lu\n", info->idle);
- return 0;
- }
|