This is a script which uses a background image, resizes it to show correctly on any multimonitor setup.
The idea for this project was shamelessly copied from guimeira's i3lock-fancy-multimonitor.
It uses ImageMagick to resize the background image. You can replace this image to change background.
By using information from xrandr and basic math, this script supports multiple monitor setups, displaying the background image on all screens.
It caches the generated image for different screen sizes and xrandr output. So even though first lock
command will take a second to finish, subsequent lock
will be lighting fast.
Make sure you have all the dependencies: Note - Instructions are for Ubuntu since its the most popular linux distro.
sudo apt-get install imagemagick i3lock
Copy the lock
script along with the images to some place on your system (e.g.: the i3 folder) and give it execution permission:
git clone \
"https://github.com/theUncanny/i3lock-multimonitor.git" \
"${HOME}/.i3/i3lock-multimonitor" && \
chmod a+x ~/.i3/i3lock-multimonitor/lock && \
sudo ln -sfn ~/.i3/i3lock-multimonitor/lock /usr/local/bin/lock-multimonitor
Create a key binding on your i3 config file (in this example I'm using $mod+p):
echo "bindsym \$mod+p exec /home/$USER/.i3/i3lock-multimonitor/lock" >> ~/.i3/config
Now reload the i3 configuration file. By default, the key binding is $mod+Shift+c
.
Use on CLI (example):
lock-multimonitor -i "${HOME}/Wallpapers/Varios/programming-1516205757967-4762.jpg"