From ed7185dca8b01a33d238866854ac6ec3ad4e0114 Mon Sep 17 00:00:00 2001 From: felipe stival Date: Fri, 2 Oct 2020 09:49:39 -0300 Subject: [PATCH] Throw error when trying to start on Wayland (#290) --- i3lock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i3lock.c b/i3lock.c index 0c3f5b65..e855a751 100644 --- a/i3lock.c +++ b/i3lock.c @@ -1038,6 +1038,8 @@ int main(int argc, char *argv[]) { err(EXIT_FAILURE, "getpwuid() failed"); if ((username = pw->pw_name) == NULL) errx(EXIT_FAILURE, "pw->pw_name is NULL."); + if (getenv("WAYLAND_DISPLAY") != NULL) + errx(EXIT_FAILURE, "i3lock is a program for X11 and does not work on Wayland. Try https://github.com/swaywm/swaylock instead"); char *optstring = "hvnbdc:p:ui:teI:f"; while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) {