2020-12-15 20:43:31 +01:00
|
|
|
#!/usr/bin/env bash
|
2019-04-27 16:35:17 +02:00
|
|
|
|
|
|
|
images=()
|
|
|
|
swaylock_args=()
|
|
|
|
|
|
|
|
swaylock_args+=(-e)
|
|
|
|
|
|
|
|
for output in $(swaymsg -t get_outputs | jq -r '.[] .name'); do
|
2019-04-28 18:59:35 +02:00
|
|
|
image=$(mktemp --suffix=.png)
|
|
|
|
images+=("$image")
|
|
|
|
swaylock_args+=(-i "$output":"$image")
|
|
|
|
grim -o "$output" "$image"
|
2019-04-27 16:35:17 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
printf '%s\n' "${images[@]}" | xargs -P 0 -I{} convert -resize 20% -level 0%,100%,0.9 -blur 0x2 -resize 500% {} {}
|
|
|
|
|
2019-10-30 11:50:52 +01:00
|
|
|
if command -v physlock 2>/dev/null; then
|
|
|
|
physlock -l prevent tty switching
|
|
|
|
swaylock "${swaylock_args[@]}" -s center
|
|
|
|
physlock -L reenable tty switching
|
|
|
|
else
|
|
|
|
swaylock "${swaylock_args[@]}" -s center
|
|
|
|
fi
|
|
|
|
|
2019-04-28 18:59:35 +02:00
|
|
|
rm "${images[@]}"
|