adaptive sync
This commit is contained in:
@@ -189,6 +189,12 @@ sudo emerge --ask games-util/gamemode
|
|||||||
- `mangohud` is **not in the main Gentoo tree** — GURU overlay
|
- `mangohud` is **not in the main Gentoo tree** — GURU overlay
|
||||||
(`sudo emerge --ask games-util/mangohud` after enabling GURU).
|
(`sudo emerge --ask games-util/mangohud` after enabling GURU).
|
||||||
|
|
||||||
|
Adaptive sync (sway): the desktop runs at a fixed 240 Hz with VRR off, because
|
||||||
|
sway only renders on change and idle frame rates fall below the panel's 48 Hz
|
||||||
|
floor (out of LFC range → flicker). `sway/scripts/vrr-follow` turns VRR on for
|
||||||
|
DP-1 only while the visible workspace has a fullscreen window; `lock-now` turns
|
||||||
|
it off while locked. Needs `jq`.
|
||||||
|
|
||||||
### GPU monitoring & tuning
|
### GPU monitoring & tuning
|
||||||
|
|
||||||
**Arch**
|
**Arch**
|
||||||
|
|||||||
+3
-1
@@ -38,7 +38,9 @@ exec --no-startup-id ~/.config/sway/scripts/wallpaper-rotate $wallpaper_dir
|
|||||||
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
# You can get the names of your outputs by running: swaymsg -t get_outputs
|
||||||
# adaptive_sync on the desktop makes sway stutter/flicker; 120Hz avoids AMD
|
# adaptive_sync on the desktop makes sway stutter/flicker; 120Hz avoids AMD
|
||||||
# VRAM clock flicker at high refresh (see README).
|
# VRAM clock flicker at high refresh (see README).
|
||||||
output DP-1 mode 1920x1080@120Hz adaptive_sync off allow_tearing yes
|
output DP-1 mode 1920x1080@240Hz adaptive_sync off allow_tearing yes
|
||||||
|
exec_always pkill -xf '/bin/sh /home/nnduc/.config/sway/scripts/vrr-follow'; ~/.config/sway/scripts/vrr-follow
|
||||||
|
#output DP-1 mode 1920x1080@240Hz adaptive_sync on allow_tearing yes
|
||||||
|
|
||||||
### Idle configuration
|
### Idle configuration
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
wall_dir="${1:?wallpaper directory required}"
|
wall_dir="${1:?wallpaper directory required}"
|
||||||
img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1)
|
img=$(find "$wall_dir" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) | shuf -n1)
|
||||||
if [ -n "$img" ]; then
|
swaymsg -q output DP-1 adaptive_sync off # lock screen redraws rarely: fixed 240 Hz
|
||||||
exec swaylock -f -i "$img"
|
swaylock -f ${img:+-i "$img"}
|
||||||
else
|
# once unlocked, let vrr-follow decide again (in background so swayidle/suspend aren't held up)
|
||||||
exec swaylock -f
|
( while pgrep -x swaylock >/dev/null; do sleep 1; done
|
||||||
fi
|
~/.config/sway/scripts/vrr-follow once ) &
|
||||||
|
|||||||
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# adaptive_sync on DP-1 only while the visible workspace shows a fullscreen window
|
||||||
|
OUT=DP-1
|
||||||
|
update() {
|
||||||
|
if [ "$(swaymsg -t get_tree | jq --arg o "$OUT" '
|
||||||
|
.nodes[] | select(.name==$o) as $out | $out.nodes[]
|
||||||
|
| select(.name==$out.current_workspace)
|
||||||
|
| [.. | objects | select((.fullscreen_mode? // 0) > 0)] | length')" -gt 0 ]
|
||||||
|
then s=on; else s=off; fi
|
||||||
|
[ "$s" != "$last" ] && swaymsg -q output "$OUT" adaptive_sync "$s" && last=$s
|
||||||
|
}
|
||||||
|
[ "$1" = once ] && { update; exit; }
|
||||||
|
update
|
||||||
|
swaymsg -t subscribe -m '["workspace","window"]' | while read -r _; do update; done
|
||||||
Reference in New Issue
Block a user