1234567891011121314151617181920212223242526272829 |
- #include <X11/extensions/scrnsaver.h>
- #include <stdio.h>
- int 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;
- }
|