aboutsummaryrefslogtreecommitdiff
path: root/sway/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/main.c b/sway/main.c
index 12f92bd8..b118a182 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -299,6 +299,14 @@ int main(int argc, char **argv) {
}
}
+ // Since wayland requires XDG_RUNTIME_DIR to be set, abort with just the
+ // clear error message (when not running as an IPC client).
+ if (!getenv("XDG_RUNTIME_DIR") && optind == argc) {
+ fprintf(stderr,
+ "XDG_RUNTIME_DIR is not set in the environment. Aborting.\n");
+ exit(EXIT_FAILURE);
+ }
+
// As the 'callback' function for wlr_log is equivalent to that for
// sway, we do not need to override it.
if (debug) {