adaptive sync

This commit is contained in:
nnduc
2026-10-19 23:21:54 +07:00
parent 9b8320cead
commit 96467a1c56
15 changed files with 169 additions and 848 deletions
+2 -2
View File
@@ -3,6 +3,6 @@ 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, let vrr-follow decide again (in background so swayidle/suspend aren't held up)
# once unlocked, turn VRR back on if a game (gamemode) is still running
( while pgrep -x swaylock >/dev/null; do sleep 1; done
~/.config/sway/scripts/vrr-follow once ) &
gamemoded -s | grep -q 'is active' && swaymsg -q output DP-1 adaptive_sync on ) &