28 lines
		
	
	
		
			659 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			659 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
 | 
						|
    echo "OUT: $OUTPUT" >> "$HOME/outputs"
 | 
						|
    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
 | 
						|
 | 
						|
echo "done" >> "$HOME/outputs"
 | 
						|
 | 
						|
swaylock $LOCKARGS --daemonize
 | 
						|
rm $IMAGES
 |