unixchat-scripts

fork of github.com/unixchat/scripts
git clone git://git.pyratebeard.net/unixchat-scripts.git
Log | Files | Refs | README

commit 60a230d7e5025350e25f0e09fb64a15ec250913c
parent 9d0ef51acbf48be010fc5bdfcc1a55ad595238ac
Author: dcat <dcat@iotek.org>
Date:   Wed, 14 Jul 2021 18:58:23 +0200

lockscreen

Diffstat:
Ascramblelock | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/scramblelock b/scramblelock @@ -0,0 +1,25 @@ +#!/bin/sh +# selectively blur windows and use that as a lock screen via `i3lock` +# depends on; +# - imagemagick convert +# - wmutils +# - i3lock + +AMOUNT=1 +NOISE=2 +ORIG="`mktemp /tmp/scrlock.XXXX.png`" +SCRAMBLE="`mktemp /tmp/scrlock.XXXX.png`" +trap "rm -f $ORIG $SCRAMBLE" exit + +sleep 0.05 +scrot $ORIG + +for WID in `lsw` +do + REGION="`wattr whxy $WID | sed 's/ /x/; s/ /+/g'`" + COMMANDS="$COMMANDS -region $REGION -statistic mode $AMOUNT +noise uniform +region -region $REGION -noise $NOISE +noise uniform +region" +done + +convert $ORIG $COMMANDS $SCRAMBLE + +i3lock -n -u -i $SCRAMBLE