summaryrefslogtreecommitdiffstats
path: root/src/x11util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11util.h')
-rw-r--r--src/x11util.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/x11util.h b/src/x11util.h
new file mode 100644
index 0000000..6389a7c
--- /dev/null
+++ b/src/x11util.h
@@ -0,0 +1,28 @@
+#ifndef _X11_UTIL_H_
+#define _X11_UTIL_H_
+
+#include <stdbool.h>
+#include <time.h>
+
+#define SAVER_OFF (0)
+#define SAVER_ACTIVE (1)
+#define SAVER_LOCKED (2)
+
+#define SCREEN_UNKNOWN (0)
+#define SCREEN_ON (1)
+#define SCREEN_OFF (2)
+
+struct x11state {
+ time_t lockTimestamp;
+ int idleSeconds;
+ int saverState;
+ int screenStandby;
+};
+
+bool getX11IdleTimes( const char *xauth, const char *display, struct x11state *state );
+
+void setScreenDpms( const char *xauth, const char *display, int mode );
+
+void enableScreenSaver( const char *xauth, const char *display, const int state );
+
+#endif