diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-05-21 11:38:53 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-05-21 11:43:06 +0200 |
commit | 4e65fd1d1aa0ee4aa328eea4eac37f2580490fac (patch) | |
tree | abd0b863837ce0c4435e289765294b5a90ca3837 /bin | |
parent | 9560f3bdbf94484e669cf1abc9cccc4815a32d99 (diff) |
added multmonitor support
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/guiscripts/locker | 23 |
1 files changed, 18 insertions, 5 deletions
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 |