scramblelock (575B)
1 #!/bin/sh 2 # selectively blur windows and use that as a lock screen via `i3lock` 3 # depends on; 4 # - imagemagick convert 5 # - wmutils 6 # - i3lock 7 8 AMOUNT=1 9 NOISE=2 10 ORIG="`mktemp /tmp/scrlock.XXXX.png`" 11 SCRAMBLE="`mktemp /tmp/scrlock.XXXX.png`" 12 trap "rm -f $ORIG $SCRAMBLE" exit 13 14 sleep 0.05 15 scrot $ORIG 16 17 for WID in `lsw` 18 do 19 REGION="`wattr whxy $WID | sed 's/ /x/; s/ /+/g'`" 20 COMMANDS="$COMMANDS -region $REGION -statistic mode $AMOUNT +noise uniform +region -region $REGION -noise $NOISE +noise uniform +region" 21 done 22 23 convert $ORIG $COMMANDS $SCRAMBLE 24 25 i3lock -n -u -i $SCRAMBLE