From fa4080a89ddfa2833a68b6347db0e219d7afd4c4 Mon Sep 17 00:00:00 2001 From: Raymond Li Date: Sun, 22 Sep 2019 20:00:56 -0400 Subject: [PATCH 1/2] Merge from upstream and small wording/linking fixes --- README.md | 2 +- configure.ac | 2 +- i3lock.1 | 22 +++++++++++++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0055710..9b9e729 100644 --- a/README.md +++ b/README.md @@ -121,4 +121,4 @@ make Upstream -------- -Please submit pull requests for i3lock things to https://github.com/i3/i3lock and pull requests for features to me here at https://github.com/PandorasFox/i3lock-color. +Please submit pull requests for i3lock things to https://github.com/i3/i3lock and pull requests for additional features on top of regular i3lock at https://github.com/PandorasFox/i3lock-color. diff --git a/configure.ac b/configure.ac index 2639bf9..20cab58 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Run autoreconf -fi to generate a configure script from this file. AC_PREREQ([2.69]) -AC_INIT([i3lock-color], [2.10], [https://github.com/chrjguill/i3lock-color/issues]) +AC_INIT([i3lock-color], [2.12], [https://github.com/PandorasFox/i3lock-color/issues]) # For AX_EXTEND_SRCDIR AX_ENABLE_BUILDDIR AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2]) diff --git a/i3lock.1 b/i3lock.1 index 9e5578f..8e1c3ce 100644 --- a/i3lock.1 +++ b/i3lock.1 @@ -83,7 +83,24 @@ as x:. The supported pixel formats are: The "native" pixel format expects a pixel as a 32-bit (4-byte) integer in the machine's native endianness, with the upper 8 bits unused. Red, green and blue are stored in the remaining bits, in that order. -Example: \-\-raw=1920x1080:rgb + +.BR Example: +.Vb 6 +\& --raw=1920x1080:rgb +.Ve + +.BR +You can use ImageMagick’s +.IR convert(1) +program to feed raw images into i3lock: + +.BR +.Vb 6 +\& convert wallpaper.jpg RGB:- | i3lock --raw 3840x2160:rgb --image /dev/stdin +.Ve + +This allows you to load a variety of image formats without i3lock having to +support each one explicitly. .TP .BI \-c\ rrggbb \fR,\ \fB\-\-color= rrggbb @@ -440,6 +457,9 @@ The \-I (-\-inactivity-timeout=seconds) was removed because it only makes sense .IR xautolock(1) \- use i3lock as your screen saver +.IR convert(1) +\- feed a wide variety of image formats to i3lock + .SH AUTHOR Michael Stapelberg From 044ee1a2b24c6095ff533d3c897decadcacbbe97 Mon Sep 17 00:00:00 2001 From: Raymond Li Date: Wed, 25 Sep 2019 12:23:27 -0400 Subject: [PATCH 2/2] Revert i3@dcfcba3. See i3#231 --- Makefile.am | 4 ---- i3lock.1 | 5 ----- i3lock.c | 44 ++------------------------------------------ 3 files changed, 2 insertions(+), 51 deletions(-) diff --git a/Makefile.am b/Makefile.am index d4f3bbf..0dea5de 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,7 +69,3 @@ EXTRA_DIST = \ LICENSE \ README.md \ I3LOCK_VERSION - -# SUID the executable so it has permissions to lock TTY switching -install-exec-hook: - chmod +s $(DESTDIR)$(bindir)/i3lock$(EXEEXT) diff --git a/i3lock.1 b/i3lock.1 index 8e1c3ce..50971b8 100644 --- a/i3lock.1 +++ b/i3lock.1 @@ -29,7 +29,6 @@ i3lock-color \- improved screen locker .RB [\|\-e\|] .RB [\|\-f\|] .RB [\|\-m\|] -.RB [\|\-l\|] .SH DESCRIPTION .B i3lock-color @@ -134,10 +133,6 @@ your computer with the enter key. .B \-f, \-\-show-failed-attempts Show the number of failed attempts, if any. -.TP -.B \-l, \-\-lock-console -Lock the console to disable TTY switching (Linux only). - .TP .B \-\-debug Enables debug logging. diff --git a/i3lock.c b/i3lock.c index 75423a2..dc3f961 100644 --- a/i3lock.c +++ b/i3lock.c @@ -49,11 +49,6 @@ #endif #include #include -#if defined(__linux__) -#include -#include -#include -#endif #include "i3lock.h" #include "xcb.h" @@ -1486,7 +1481,6 @@ int main(int argc, char *argv[]) { {"slideshow-interval", required_argument, NULL, 903}, {"slideshow-random-selection", no_argument, NULL, 904}, - {"lock-console", no_argument, NULL, 'l'}, {NULL, no_argument, NULL, 0}}; if ((pw = getpwuid(getuid())) == NULL) @@ -1494,7 +1488,7 @@ int main(int argc, char *argv[]) { if ((username = pw->pw_name) == NULL) errx(EXIT_FAILURE, "pw->pw_name is NULL."); - char *optstring = "hvnbdc:p:ui:teI:frsS:kB:ml"; + char *optstring = "hvnbdc:p:ui:teI:frsS:kB:m"; char *arg = NULL; int opt = 0; while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) { @@ -1550,13 +1544,6 @@ int main(int argc, char *argv[]) { case 'f': show_failed_attempts = true; break; - case 'l': - #if defined(__linux__) - lock_tty_switching = true; - #else - errx(EXIT_FAILURE, "TTY switch locking is only supported on Linux."); - #endif - break; case 'r': if (internal_line_source != 0) { errx(EXIT_FAILURE, "i3lock-color: Options line-uses-ring and line-uses-inside conflict."); @@ -2037,7 +2024,7 @@ int main(int argc, char *argv[]) { break; default: errx(EXIT_FAILURE, "Syntax: i3lock [-v] [-n] [-b] [-d] [-c color] [-u] [-p win|default]" - " [-i image.png] [-t] [-e] [-f] [-l]\n" + " [-i image.png] [-t] [-e] [-f]\n" "Please see the manpage for a full list of arguments."); } } @@ -2270,21 +2257,6 @@ int main(int argc, char *argv[]) { if (main_loop == NULL) errx(EXIT_FAILURE, "Could not initialize libev. Bad LIBEV_FLAGS?"); -#if defined(__linux__) - - /* Lock tty switching */ - if (lock_tty_switching) { - if ((term = open("/dev/console", O_RDWR)) == -1) { - perror("error locking TTY switching: opening console failed"); - } - - if (term != -1 && (ioctl(term, VT_LOCKSWITCH)) == -1) { - perror("error locking TTY switching: locking console failed"); - } - } - -#endif - /* Explicitly call the screen redraw in case "locking…" message was displayed */ auth_state = STATE_AUTH_IDLE; redraw_screen(); @@ -2325,18 +2297,6 @@ int main(int argc, char *argv[]) { return 0; } -#if defined(__linux__) - /* Restore tty switching */ - if (lock_tty_switching) { - if (term != -1 && (ioctl(term, VT_UNLOCKSWITCH)) == -1) { - perror("error unlocking TTY switching: unlocking console failed"); - } - - close(term); - } - -#endif - DEBUG("restoring focus to X11 window 0x%08x\n", stolen_focus); xcb_ungrab_pointer(conn, XCB_CURRENT_TIME); xcb_ungrab_keyboard(conn, XCB_CURRENT_TIME);