Skip to content

Instantly share code, notes, and snippets.

@gngdb
Created September 17, 2019 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gngdb/4fc27f64e5599d197e33b2bd6f18cdcd to your computer and use it in GitHub Desktop.
Save gngdb/4fc27f64e5599d197e33b2bd6f18cdcd to your computer and use it in GitHub Desktop.
bashrc snippet for creating images for i3lock to use as a lockscreen background.
# for making lockscreen images
set-i3lock-bg() {
if [ ! -f ~/lock.png ]; then
curl https://raw.githubusercontent.com/meskarune/i3lock-fancy/master/icons/lock.png > ~/lock.png
fi
SIZE=`xdpyinfo | grep dimensions | cut -d " " -f 7`
convert $1 -font Liberation-Sans \
-geometry $SIZE -gravity center\
-pointsize 26 -fill white -extent $SIZE -gravity center \
-annotate +0+160 "Type Password to Unlock" ~/lock.png \
-gravity center -composite ~/i3-background.png
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment