aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-06-07 11:43:48 -0500
committerDevin J. Pohly <djpohly@gmail.com>2020-06-07 11:43:48 -0500
commit14063d58bbe2a262cf39b875f89a20493fe86afa (patch)
treef050588f36ee88919e037a63b170b916d58a8f6e /dwl.c
parentf19d00b94a6ba56ba4e2ca72b56a6d0345bed7d9 (diff)
Handle missing XDG_RUNTIME_DIR explicitly
Also update the documentation to indicate that this is a Wayland thing and not dwl-specific.
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 7305f53..dfbafce 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1527,6 +1527,13 @@ main(int argc, char *argv[])
goto usage;
wlr_log_init(loglevel, NULL);
+ // Wayland requires XDG_RUNTIME_DIR for creating its communications
+ // socket
+ if (!getenv("XDG_RUNTIME_DIR")) {
+ fprintf(stderr, "XDG_RUNTIME_DIR must be set\n");
+ exit(EXIT_FAILURE);
+ }
+
/* The Wayland display is managed by libwayland. It handles accepting
* clients from the Unix socket, manging Wayland globals, and so on. */
dpy = wl_display_create();