Selectively scrambling data in Xorg windows

most lockscreens either display an alternative wallpaper, a screensaver, or just blank the screen; but I know that won't cut it for you ricers.

in order to show off your glorious colorschemes, layouts, and wallpaper we'll have to find the confines of the windows currently on the screen. using lsw(list windows) and wattr(window attributes) from wmutils/core we can loop through each window on the screen and get its geometry, and at the same time convert it to Xorg geometry specifications. then cook up some arguments for ImageMagicks convert(1) as such;

for WID in `lsw`
do
    REGION="`wattr whxy $WID | sed 's/ /x/; s/ /+/g'`"
    COMMANDS="$COMMANDS -region $REGION -statistic mode 1.0 +region"
done

we declare a region, set its confines to $REGION, tell it to replace each pixel with its corresponding statistic from the neighborhood using the mode (most frequent) method.

then we take a screenshot using scrot, and pump the $COMMANDS through imagemagick.

scrot myscreenshot.png
convert myscreenshot.png $COMMANDS myscrambledscreenshot.png

/pub/img/1f0c73594b53709b7df0d8a3de6df835.png

now you can use myscrambledscreenshot.png in conjunction with your lockscreen of choice.

Caveats