aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/bar.c
diff options
context:
space:
mode:
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) {
586 } 586 }
587 587
588 bar->display = wl_display_connect(NULL); 588 bar->display = wl_display_connect(NULL);
589 assert(bar->display); 589 if (!bar->display) {
590 sway_abort("Unable to connect to the compositor. "
591 "If your compositor is running, check or set the "
592 "WAYLAND_DISPLAY environment variable.");
593 }
590 594
591 struct wl_registry *registry = wl_display_get_registry(bar->display); 595 struct wl_registry *registry = wl_display_get_registry(bar->display);
592 wl_registry_add_listener(registry, &registry_listener, bar); 596 wl_registry_add_listener(registry, &registry_listener, bar);