Skip to content

Instantly share code, notes, and snippets.

@JamesTheBard
Created June 8, 2013 00:04
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JamesTheBard/5733235 to your computer and use it in GitHub Desktop.
Save JamesTheBard/5733235 to your computer and use it in GitHub Desktop.
The cool pixelated i3lock script provided by Steffan Honig.
#!/bin/bash
#
# This is an easier-to-tweak version of Steffen Honig's i3lock
# script. If it doesn't work, it's his fault ;)
#
TEMP_FILE=/tmp/lock.png
TEMP_FILE_POST=/tmp/lock.modified.png
BAR_BG_COLOR="orange"
BAR_FONT_COLOR="white"
BAR_FONT="Source-Code-Pro-Black"
BAR_WIDTH="1920"
BAR_HEIGHT="30"
MOGRIFY_OPTS="-scale 10% -scale 1000% $TEMP_FILE"
MESSAGE="SYSTEM LOCKED: $USER"
CONVERT_OPTS="-background $BAR_BG_COLOR -gravity center -fill $BAR_FONT_COLOR -font $BAR_FONT -size ${BAR_WIDTH}x${BAR_HEIGHT} caption:@- $TEMP_FILE +swap -composite $TEMP_FILE_POST"
rm $TEMP_FILE $TEMP_FILE_POST
scrot $TEMP_FILE
mogrify $MOGRIFY_OPTS
echo $MESSAGE | tr -d "\n" | convert $CONVERT_OPTS
i3lock -i $TEMP_FILE_POST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment