A simple box-blur based on i3lock-fancy-rapid.
The script was originally intended to be used with swaylock, but can generally be used for any blurring or with other screen locking utilities.
Call make
in the root directory to build the binary rapid-blur
.
A subsequent make install
call will add a symlink to /usr/bin
.
You can generally use the script to blur any image with:
rapid-blur IMAGE OUTPUT
To customize the level of blur, one can set the radius with -r
and times with -t
rapid-blur -r 5 -t 3 IMAGE OUTPUT
To pixelate instead, pass the -p
flag
rapid-blur -p IMAGE OUTPUT
To use it with swaylock, you can simply include it in a simple script similar to the one below:
#!/bin/sh
DISPLAYS="$(swaymsg -t get_outputs -p | awk '/Output/ && !/disabled/ {print $2}')"
# Reverse Displays (So external 4K is started first)
DISPLAYS=$(tac -s ' ' <<< $(echo $DISPLAYS))
BASE_FILE="${TMPDIR:-/tmp/ss}"
for display in $DISPLAYS; do
FILE="${BASE_FILE}${display}"
grim -o "$display" "$FILE.png"
rapid-blur "$FILE.png" "$FILE-out.png" &
args="$args -i ${display}:${FILE}-out.png"
done
wait
swaylock $args