dotfiles/bin/swaylock-blur

25 lines
572 B
Bash
Executable File

#!/usr/bin/env bash
#
#
# Dependancies:
# imagemagick
# swaylock
# grim
#
# inspired by: https://gist.github.com/singulared/7c6d53c1b84fbb7cf22d07c5c7d3e945
LOCK=~/.config/sway/lock.png
# go over each output and ss/blur then add to img
for OUTPUT in $(swaymsg -t get_outputs | gojq '.[].name' | tr -d '"')
do
IMAGE="${OUTPUT}_img.jpg"
grim -t jpeg -o $OUTPUT $IMAGE
convert $IMAGE -blur 5x3 - | composite -gravity center $LOCK - $IMAGE
LOCKARGS="${LOCKARGS} --image ${OUTPUT}:${IMAGE}"
IMAGES="${IMAGES} ${IMAGE}"
done
swaylock $LOCKARGS
rm $IMAGES