From 4e65fd1d1aa0ee4aa328eea4eac37f2580490fac Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sun, 21 May 2023 11:38:53 +0200 Subject: added multmonitor support --- bin/guiscripts/locker | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'bin/guiscripts') diff --git a/bin/guiscripts/locker b/bin/guiscripts/locker index f464617..c35f6d4 100755 --- a/bin/guiscripts/locker +++ b/bin/guiscripts/locker @@ -2,8 +2,21 @@ which swaylock grim pixelate > /dev/null || exit 1 umask 077 -file=/tmp/bg.png -grim -l 0 - > $file -pixelate $file $file -swaylock -u -i $file -shred -uz $file + +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 -- cgit v1.2.3