aboutsummaryrefslogtreecommitdiff
path: root/swaylock
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 /swaylock
parent05284b65db5f3cdfa88d7e06055aadd0d5fa8e50 (diff)
parentcd02d60a992ee38689a0d17fc69c4e2b1956f266 (diff)
Merge branch 'master' into set-set-raw-focus
Diffstat (limited to 'swaylock')
-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,
}
break;
case 'v':
-#if defined SWAY_GIT_VERSION && defined SWAY_GIT_BRANCH && defined SWAY_VERSION_DATE
- fprintf(stdout, "swaylock version %s (%s, branch \"%s\")\n",
- SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH);
-#else
- fprintf(stdout, "version unknown\n");
-#endif
- return 1;
+ fprintf(stdout, "swaylock version " SWAY_VERSION "\n");
+ exit(EXIT_SUCCESS);
+ break;
case LO_BS_HL_COLOR:
if (state) {
state->args.colors.bs_highlight = parse_color(optarg);
@@ -908,7 +904,11 @@ int main(int argc, char **argv) {
wl_list_init(&state.surfaces);
state.xkb.context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
state.display = wl_display_connect(NULL);
- assert(state.display);
+ if (!state.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(state.display);
wl_registry_add_listener(registry, &registry_listener, &state);