I3 fuzzy lock and suspend
Install packages.
Create fuzzy_lock.sh file.~/.config/i3/fuzzy_lock.sh
Make it executable.
Create suspend.sh file.
Add the following lines to the i3 config.
#!/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
fi
~/.config/i3/config
bindsym control+mod1+l exec /home/tdgraaff/.config/i3/fuzzy_lock.sh
bindsym control+mod1+s exec /home/tdgraaff/.config/i3/suspend.sh
exec --no-startup-id xautolock -detectsleep -time 15 -locker /home/tdgraaff/.config/i3/fuzzy_lock.sh &
exec --no-startup-id xautolock -detectsleep -time 60 -locker /home/tdgraaff/.config/i3/suspend.sh &
Press
Modifier+Shift+c
to reload the i3 config. PressCtrl+Alt+l
to lock the screen, andCtrl+Alt+s
to suspend. The screen will autolock after 15 minutes and the system will suspend automatically after an hour.