Throw error when trying to start on Wayland (#290)

pull/296/head
felipe stival 2020-10-02 09:49:39 -03:00 committed by GitHub
parent 9f675b8a85
commit ed7185dca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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) {