Skip to content

I3 fuzzy lock and suspend

Install packages.

sudo apt install imagemagick scrot
Create file.
#!/bin/sh -e

rm -f /tmp/screen_locked.png

# Take a screenshot
scrot /tmp/screen_locked.png

# Pixellate it 10x
mogrify -scale 25% -scale 400% /tmp/screen_locked.png

# Lock screen displaying this image.
i3lock -i /tmp/screen_locked.png

# Optionally suspend.
if [ "$1" == "suspend" ]; then
  systemctl suspend
Make it executable.
chmod +x ~/
Create file.
systemctl suspend
Add the following lines to the i3 config.
bindsym control+mod1+l exec /home/tdgraaff/.config/i3/
bindsym control+mod1+s exec /home/tdgraaff/.config/i3/
exec --no-startup-id xautolock -detectsleep -time 5 -locker /home/tdgraaff/.config/i3/ -killtime 60 -killer "systemctl suspend" &

Press Modifier+Shift+c to reload the i3 config. Press Ctrl+Alt+l to lock the screen, and Ctrl+Alt+s to suspend. The screen will autolock after 15 minutes and the system will suspend automatically after an hour.

Back to top