.config/i3/screenlocker.sh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
#!/usr/bin/env bash # script for locking my screen on Arch using i3lock # x1phosura # thanks to http://www.michaelabrahamsen.com/posts/custom-lockscreen-i3lock/ # set icon and temporary photo location icon="$HOME/.config/i3/icon.png" tmpbg='/tmp/screenshot-temp.png' # cleans up if screenshot already exists because scrot won't overwrite rm -f $tmpbg # takes a screenshot of the current screen (relies on 'scrot' package) scrot "$tmpbg" # blur the screenshot by resizing and scaling back up (relies on 'imagemagick') convert "$tmpbg" -filter Gaussian -thumbnail 20% -sample 500% "$tmpbg" # overlay the icon onto the temporary screenshot convert "$tmpbg" "$icon" -gravity center -composite "$tmpbg" # thank you to https://github.com/PandorasFox/i3lock-color/blob/master/lock.sh # colors for i3lock-color B='#00000000' # blank or 'nothing' D='#aaaaaacc' # default W='#dd0000ff' # wrong red V='#22bb88ff' # verifying # lock the screen with the blurred picture AND lock icon settings i3lock \ --insidever-color=$V \ --ringver-color=$V \ \ --insidewrong-color=$W \ --ringwrong-color=$W \ \ --inside-color=$B \ --ring-color=$D \ --line-color=$B \ --separator-color=$D \ \ --time-color=$B \ --date-color=$B \ \ --verif-color=$B \ --wrong-color=$B \ --keyhl-color='4466ccff' \ --bshl-color='000000ff' \ \ --screen 1 \ --indicator \ --ind-pos="x+1280:h-710" \ --verif-align 1 \ --wrong-align 1 \ --radius=100 \ --ring-width=4 \ -i "$tmpbg" # --image="$tmpbg" |