aboutsummaryrefslogtreecommitdiff
path: root/swaybar/bar.c
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-10-16 10:50:56 +0100
committerGitHub <noreply@github.com>2018-10-16 10:50:56 +0100
commitac20690945f1cd44c4c22267c9e7a172ebcf5ba5 (patch)
tree994739d4ba8388d7a336ac825a618daf2274ec66 /swaybar/bar.c
parent05284b65db5f3cdfa88d7e06055aadd0d5fa8e50 (diff)
parentcd02d60a992ee38689a0d17fc69c4e2b1956f266 (diff)
Merge branch 'master' into set-set-raw-focus
Diffstat (limited to 'swaybar/bar.c')
-rw-r--r--swaybar/bar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c
index be290c18..0deba72d 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -586,7 +586,11 @@ bool bar_setup(struct swaybar *bar, const char *socket_path) {
}
bar->display = wl_display_connect(NULL);
- assert(bar->display);
+ if (!bar->display) {
+ sway_abort("Unable to connect to the compositor. "
+ "If your compositor is running, check or set the "
+ "WAYLAND_DISPLAY environment variable.");
+ }
struct wl_registry *registry = wl_display_get_registry(bar->display);
wl_registry_add_listener(registry, &registry_listener, bar);