Skip to content

Instantly share code, notes, and snippets.

@root-talis
Created February 21, 2025 08:59
Show Gist options
  • Save root-talis/7085ebced615717570e53aa48263cdd8 to your computer and use it in GitHub Desktop.
Save root-talis/7085ebced615717570e53aa48263cdd8 to your computer and use it in GitHub Desktop.
i3lock with screenshot (oli-like blur)
#!/bin/bash
FILENAME=/tmp/.lock-bg.$USER.png
# cleanup previous run (if any is remaining)
rm $FILENAME
# wait for rofi to close (optional - uncomment if you don't wanna see a leftover of rofi menu)
#sleep 1
# take screenshot and blur it in memory, and dump only blurred version to disk
scrot -z - | magick convert png:- -blur 3x2 -paint 3 "png:$FILENAME"
# lock screen as a bg job
i3lock --image $FILENAME &
# wait for i3lock to read the screenshot and immideately delete it from disk
sleep 1
rm $FILENAME
# wait for i3lock to finish
wait
@root-talis
Copy link
Author

This is how it looks. Modify arguments of blur and paint in magick convert to tweak the effect.
2025-02-21-120909_2560x1440_scrot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment