From d9fcd23c1941367509a5d9f20ad0ca51a14fbebf Mon Sep 17 00:00:00 2001 From: Raymond Li Date: Sun, 15 Mar 2020 22:05:28 -0400 Subject: [PATCH] Add instructions to resize image --- README.md | 5 ++++- i3lock.1 | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 84f2a16..839f14e 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,10 @@ i3lock is a simple screen locker like slock. After starting it, you will see a w Many little improvements have been made to i3lock over time: - i3lock forks, so you can combine it with an alias to suspend to RAM (run "i3lock && echo mem > /sys/power/state" to get a locked screen after waking up your computer from suspend to RAM) -- You can specify either a background color or an image (JPG or PNG), which will be displayed while your screen is locked. Note that i3lock is not an image manipulation software. If you need to resize the image to fill the screen or similar, use existing tooling to do this before passing it to i3lock. I hope to add this functionality to i3lock-color in the near future. +- You can specify either a background color or an image (JPG or PNG), which will be displayed while your screen is locked. Note that i3lock is not an image manipulation software. If you need to resize the image to fill the screen, you can use something like ImageMagick combined wih `xdpyinfo`: + ```bash + convert image.jpg -resize $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') RGB:- | i3lock --raw $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'):rgb --image /dev/stdin + ``` - You can specify whether i3lock should bell upon a wrong password. - i3lock uses PAM and therefore is compatible with LDAP etc. On OpenBSD, i3lock uses the bsd\_auth(3) framework. diff --git a/i3lock.1 b/i3lock.1 index bc65e51..e97ad15 100644 --- a/i3lock.1 +++ b/i3lock.1 @@ -88,12 +88,10 @@ the remaining bits, in that order. \& --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 @@ -101,6 +99,14 @@ program to feed raw images into i3lock: This allows you to load a variety of image formats without i3lock having to support each one explicitly. +You can also use it to resize images to the screen ratio: + +.Vb 6 +\& convert wallpaper.jpg -resize $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') RGB:- | i3lock --raw $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'):rgb --image /dev/stdin +.Ve + +Note that $(xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/') gets you the current screen dimensions in the wxh (e.g. 1920x1080) format. + .TP .BI \-c\ rrggbb \fR,\ \fB\-\-color= rrggbb Turn the screen into the given color instead of white. Color must be given in 3-byte