lock (1042B)
1 #!/bin/bash 2 # 3 # parazyd - (c) wtfpl 2016 4 # make screenshot, pixelize and use as i3lock image 5 6 scrot -z /tmp/screen.png 7 convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png 8 9 if [ -f $HOME/.icons/lock.png ]; then 10 # placement x/y 11 PX=0 12 PY=0 13 # lockscreen image info 14 R=$(file ~/.icons/lock.png | grep -o '[0-9]* x [0-9]*') 15 RX=$(echo $R | cut -d' ' -f 1) 16 RY=$(echo $R | cut -d' ' -f 3) 17 18 SR=$(xrandr --query | grep ' connected' | cut -f4 -d' ') 19 for RES in $SR; do 20 # monitor position/offset 21 SRX=$(echo $RES | cut -d'x' -f 1) # x pos 22 SRY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 1) # y pos 23 SROX=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 2) # x offset 24 SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset 25 PX=$(($SROX + $SRX/2 - $RX/2)) 26 PY=$(($SROY + $SRY/2 - $RY/2)) 27 28 convert /tmp/screen.png $HOME/.icons/lock.png -geometry +$PX+$PY -composite -matte /tmp/screen.png 29 done 30 fi 31 i3lock -e -i /tmp/screen.png