9 lines
495 B
Bash
Executable File
9 lines
495 B
Bash
Executable File
#!/bin/bash
|
|
wall_dir="${1:?wallpaper directory required}"
|
|
img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1)
|
|
swaymsg -q output DP-1 adaptive_sync off # lock screen redraws rarely: fixed 240 Hz
|
|
swaylock -f ${img:+-i "$img"}
|
|
# once unlocked, turn VRR back on if a game (gamemode) is still running
|
|
( while pgrep -x swaylock >/dev/null; do sleep 1; done
|
|
gamemoded -s | grep -q 'is active' && swaymsg -q output DP-1 adaptive_sync on ) &
|