This patch adds foreground image to slock. Link to patch at the official suckless website
- imgpath - is path to image to display, image must be xpm file
- imgwidth - width of the image
- imgheight - height of the image
- imgoffsetx - image offset from left side
- imgoffsety - image offset from top side
- showimgonlyatstart - if set to 1 image will be shown only at the start (before tipying), if set to 0 image will be always shown
Download slock and slock-foreground-image.diff. Copy slock-foreground-image.diff to the same folder where you have slock source code.
patch -p1 < slock-foreground-image-20211210.diff
Xpm image is bitmap image used by X Windows System. It's one of the few image formats that is supported by Xorg by default.
Convert jpg to xpm:
convert image.jpg -geometry 1920x1080 -colors 216 image.xpm