aboutsummaryrefslogtreecommitdiffstats
path: root/swaylock/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaylock/main.c')
-rw-r--r--swaylock/main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/swaylock/main.c b/swaylock/main.c
index 27bcfe32..86dfd577 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -634,13 +634,9 @@ static int parse_options(int argc, char **argv, struct swaylock_state *state,
634 } 634 }
635 break; 635 break;
636 case 'v': 636 case 'v':
637#if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE 637 fprintf(stdout, "swaylock version " SWAY_VERSION "\n");
638 fprintf(stdout, "swaylock version %s (%s, branch \"%s\")\n", 638 exit(EXIT_SUCCESS);
639 SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH); 639 break;
640#else
641 fprintf(stdout, "version unknown\n");
642#endif
643 return 1;
644 case LO_BS_HL_COLOR: 640 case LO_BS_HL_COLOR:
645 if (state) { 641 if (state) {
646 state->args.colors.bs_highlight = parse_color(optarg); 642 state->args.colors.bs_highlight = parse_color(optarg);
@@ -908,7 +904,11 @@ int main(int argc, char **argv) {
908 wl_list_init(&state.surfaces); 904 wl_list_init(&state.surfaces);
909 state.xkb.context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); 905 state.xkb.context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
910 state.display = wl_display_connect(NULL); 906 state.display = wl_display_connect(NULL);
911 assert(state.display); 907 if (!state.display) {
908 sway_abort("Unable to connect to the compositor. "
909 "If your compositor is running, check or set the "
910 "WAYLAND_DISPLAY environment variable.");
911 }
912 912
913 struct wl_registry *registry = wl_display_get_registry(state.display); 913 struct wl_registry *registry = wl_display_get_registry(state.display);
914 wl_registry_add_listener(registry, &registry_listener, &state); 914 wl_registry_add_listener(registry, &registry_listener, &state);