commit eabfff3c36ccbfe0368a4392ede74a7b7eb34319
parent 2fd65471b282f6a82e2d0f45166ed5b3095c63dc
Author: Cassandra Fox <cass@fox.mom>
Date: Fri, 27 Sep 2019 00:01:46 -0700
Merge pull request #135 from Raymo111/master
Merge from upstream and small wording/linking changes
Diffstat:
5 files changed, 25 insertions(+), 54 deletions(-)
diff --git 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/README.md b/README.md
@@ -124,4 +124,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
@@ -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
@@ -29,7 +29,6 @@ i3lock-color \- improved screen locker
.RB [\|\-e\|]
.RB [\|\-f\|]
.RB [\|\-m\|]
-.RB [\|\-l\|]
.SH DESCRIPTION
.B i3lock-color
@@ -83,7 +82,24 @@ as <width>x<height>:<pixfmt>. 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
@@ -118,10 +134,6 @@ your computer with the enter key.
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.
Note, that this will log the password used for authentication to stdout.
@@ -440,6 +452,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 <michael+i3lock at stapelberg dot de>
diff --git a/i3lock.c b/i3lock.c
@@ -49,11 +49,6 @@
#endif
#include <xcb/xcb_aux.h>
#include <xcb/randr.h>
-#if defined(__linux__)
-#include <fcntl.h>
-#include <linux/vt.h>
-#include <sys/ioctl.h>
-#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);