Creating a blurred lockscreen on Ubuntu

This will help change up how the lock screen is presented while maintaining the same level of security as the default. Here what you’ll need to get started:

  • Ubuntu running at least 16.04 (Haven’t tested this on other versions.)
  • i3lock
  • scrot
  • imagemagick
  • xautolock

You can easily the apps from running this apt one-liner:

sudo apt install i3lock scrot imagemagick xautolock

Next up create a new bash script called “lock” in your bin folder (sudo nano /bin/bash). The script will be telling scrot to take a screenshot, save it as a defined name, apply a blur filter to it, save that as the same named image, and then have i3lock use that blurred image as a lockscreen.

Here’s the script:

#!/bin/bash

# Delete any previous screenshots
rm -f /tmp/screenshot.png
rm -f /tmp/screenshotblur.png

# Takes screenshot of desktop then saves it to tmp folder
scrot /tmp/screenshot.png

# Blurs screenshot and saves it
convert /tmp/screenshot.png -blur 0x5 /tmp/screenshotblur.png

# Make i3lock use that image
i3lock -i /tmp/screenshotblur.png

Save the script then run chmod to make it executable:
sudo chmod +x /bin/lock

Last thing I had to do was create a keyboard shortcut that tells Ubuntu to execute the script. Just go to Settings > Devices > Keyboard to bring up the list of shortcuts. Go to add a new one: