From f7cd45464fd7c037f6a60098ae77760998b3b4b6 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 10 May 2019 15:25:43 +0200 Subject: Initial commit --- src/x11util.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/x11util.h (limited to 'src/x11util.h') 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 +#include + +#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 -- cgit v1.2.3-55-g7522