summaryrefslogtreecommitdiff
path: root/checkdispsrv.c
diff options
context:
space:
mode:
Diffstat (limited to 'checkdispsrv.c')
-rw-r--r--checkdispsrv.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/checkdispsrv.c b/checkdispsrv.c
new file mode 100644
index 0000000..a7e6bbf
--- /dev/null
+++ b/checkdispsrv.c
@@ -0,0 +1,19 @@
+# include <luma/main.h>
+# include <stdint.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+void luma__checkdispsrv(uint32_t * retval) {
+ retval = 0x0;
+ char const * sesstype = getenv("XDG_SESSION_TYPE");
+ if(strncmp(sesstype,"wayland",0x10)) {
+ luma__dat.dispsrv = "wayland";
+ }
+ else if(strncmp(sesstype,"x11",0x10)) {
+ luma__dat.dispsrv = "x";
+ }
+ else {
+ printf("Environment variable $XDG_SESSION_TYPE is \"%s\", which is not understood.\n");
+ *retval = 0x1;
+ }
+}