adaptive sync

This commit is contained in:
nnduc
2026-09-27 17:16:30 +07:00
parent 37b16c4e7c
commit 9b8320cead
4 changed files with 28 additions and 6 deletions
+5 -5
View File
@@ -1,8 +1,8 @@
#!/bin/bash
wall_dir="${1:?wallpaper directory required}"
img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1)
if [ -n "$img" ]; then
exec swaylock -f -i "$img"
else
exec swaylock -f
fi
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)
( while pgrep -x swaylock >/dev/null; do sleep 1; done
~/.config/sway/scripts/vrr-follow once ) &