i3lock is an awesome screen locker. Check out the official repository i3lock. This repository includes a script with my configuration. When locked, it should display your desktop being blurred.
Tested on Ubuntu Gnome 16.04 LTS.
sudo apt install i3lock imagemagick scrot
Go to the path, where the script my-i3lock-config.sh
is located. In my case it is in my home folder $HOME/my-i3lock-config.sh
. Now we want to make the script executable. Best way is to create a directory bin
in the homedir (mkdir -p
). Then write a new script /binlock
that runs the script my-i3lock-script.sh
and save it in /bin
. Then make it executable.
$ mkdir -p ~/bin
$ cat > ~/bin/lock << 'EOF'
$ #!/bin/sh
$ exec $HOME/lock.sh
$ EOF
$ chmod +x ~/bin/lock
You need to log out and back in again, if you haven't had a ~/bin
directory before. This will add it to your PATH. Now you should be able to run lock
from the command line and it should lock the screen.
Now you can use this and set a custom keybinding in your keyboard settings. Create a new shortcut and give it a name. The command we want to set is lock
. Then add the keybinding. And now test it, it should work.