aboutsummarylogtreecommitdiffstats
path: root/swaylock-corrupter
blob: 1ca657eee70ecd3c06b516f136bc5710831fa8ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

if [ "$1" = "--help" ]  ||  [ "$1" = "-h" ]; then
	swaylock --help 2>&1| sed -e 's/swaylock/swaylock-corrupter/g' -e '/--image/d' 1>&2
else
	DISPLAYS="$(swaymsg -t get_outputs -p | grep "Output" | awk '{print $2}')"
	BASE_FILE="${TMPDIR:-/tmp/ss}"
 
	for display in $DISPLAYS; do
		FILE="${BASE_FILE}${display}.png"
		grim -o "$display" "$FILE"
		corrupter "$FILE" "$FILE"
		args="$args -i ${display}:${FILE}"
	done
 
	swaylock $args "$@"
	# double monitor fix by /u/queyenth
fi