summaryrefslogtreecommitdiff
path: root/bin/guiscripts/locker
blob: c35f6d494edf2bcf62d049af954732fbe3b29916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
which swaylock grim pixelate > /dev/null ||
	exit 1
umask 077

monitors="$(hyprctl monitors -j |
	jq -r '.[].name' |
	tr '\n' ' ' |
	sed 's,.$,,')"

for monitor in $monitors
do
	file="/tmp/locker-$monitor.png"
	grim -l 0 -o "$monitor" "$file"
	pixelate "$file" "$file"
	# Create image command for swaylock
	icmd="$icmd --image $monitor:$file"
	files="$files $file"
done

swaylock -f -u $icmd
shred -uz -- $files