Add instructions to resize image

This commit is contained in:
Raymond Li 2020-03-15 22:05:28 -04:00
parent 23078795c5
commit d9fcd23c19
No known key found for this signature in database
GPG Key ID: A014EA89B62BBB1B
2 changed files with 12 additions and 3 deletions

View File

@ -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.

View File

@ -88,12 +88,10 @@ the remaining bits, in that order.
\& --raw=1920x1080:rgb
.Ve
.BR
You can use ImageMagicks
.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