Skip to content

Instantly share code, notes, and snippets.

@j0hn
Created December 16, 2016 18:28
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 j0hn/ddf410dc38fa77bf141ba21d7bb68dce to your computer and use it in GitHub Desktop.
Save j0hn/ddf410dc38fa77bf141ba21d7bb68dce to your computer and use it in GitHub Desktop.
#!/bin/bash
# Dependencies: imagemagick, i3lock-color-git, scrot
# IMAGE=$(mktemp).png
# scrot $IMAGE
# # convert $IMAGE -level 0%,100%,0.6 -filter Gaussian -resize 30% -define filter:sigma=2.5 -resize 333.33% $IMAGE
# convert -scale 10% -scale 1000% $IMAGE $IMAGE
# i3lock -i $IMAGE
# rm $IMAGE
scr='/tmp/screenshot.png'
icon="`dirname $0`/lock-icon.png"
# To change the font used add `-font $font`
# After pointsize in the 'add fortune text section'
# font="$HOME/.local/share/fonts/Aller_Lt.ttf"
# Expand is used to convert the tabs to spaces which
# are handled better by imageMagick
fortune=$(expand -t 2 <(fortune -s))
#gradientColor='#576d95'
gradientStart='rgba(0, 0, 0, 0.8)'
gradientColor='rgba(39, 162, 33, 0.2)'
gradientDimensions='1920x1080'
scrot "$scr"
convert "$scr" -scale 10% -scale 1000%\
-size "$gradientDimensions" -gravity south-west \
radial-gradient:"$gradientColor"-"$gradientStart" -composite -matte \
"$icon" -gravity center -composite -matte \
-gravity center -pointsize 20 \
"$scr"
i3lock -i "$scr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment