forge
Explore
Log in

Don't you dare go Hollow

config: pin mpv hwdec to vaapi, plus in-flight niri work

Browse files at this commit

3d603382bce08138d01fb0ca639f77e229b7876eAhmet Kaan GümüşParent: 377311f
mpv: radv's Vulkan AV1 decode faults the VCN block on the RX 9060 XT
(VK_ERROR_DEVICE_LOST -> vcn_unified_0 ring reset), and mpv's auto-safe
prefers Vulkan over VA-API, so AV1 playback hung the GPU. Pinned to vaapi,
which decodes h264/hevc/vp9/av1 cleanly. Verified across the real library.

Other sessions' in-flight changes swept in:
- niri: border width 3, polkit agent at startup, corner-radius 16 with
  draw-border-with-background to kill the AA seam
- wallpaper_picker/restore: accept .gif, take frame [0] only so animated
  gifs stop exploding into one thumbnail per frame
- workspace_nav: from a named workspace, next/prev target the nearest
  unnamed workspace instead of jumping to the first
.config/mpv/mpv.confmodified+10 -0
@@ -2,6 +2,16 @@ asc=no
2 ao=alsa2 ao=alsa
3 audio-device=alsa/pipewire3 audio-device=alsa/pipewire
4 4
5+# GPU decode via VA-API on the RX 9060 XT (gfx1200/VCN 5.0): h264, hevc
6+# (incl. Main10), vp9 (incl. profile2) and av1 all decode in hardware.
7+#
8+# Pinned to vaapi rather than auto-safe on purpose. auto-safe prefers Vulkan
9+# Video, and radv's AV1 decode hangs the VCN block on this card — every AV1
10+# file faults with VK_ERROR_DEVICE_LOST and the kernel has to reset
11+# vcn_unified_0 to recover. vaapi decodes the same files cleanly. Retry
12+# auto-safe after a Mesa bump; if AV1 plays, the pin can be dropped.
13+hwdec=vaapi
14+
5 # Let the compositor own the window size. Without this mpv keeps the window at15 # Let the compositor own the window size. Without this mpv keeps the window at
6 # the video's aspect ratio, deriving height from whatever width it is given —16 # the video's aspect ratio, deriving height from whatever width it is given —
7 # under niri that makes the window taller than its tile and pushes the OSC17 # under niri that makes the window taller than its tile and pushes the OSC
.config/niri/config.kdlmodified+9 -3
@@ -75,7 +75,7 @@ layout {
75 }75 }
76 76
77 border {77 border {
78- width 278+ width 3
79 79
80 // WALLUST-GRADIENT80 // WALLUST-GRADIENT
81 active-gradient from="#4D0830" to="#7E420A" angle=90 in="oklch"81 active-gradient from="#4D0830" to="#7E420A" angle=90 in="oklch"
@@ -91,6 +91,7 @@ environment {
91 XCURSOR_SIZE "24"91 XCURSOR_SIZE "24"
92 }92 }
93 93
94+spawn-at-startup "sh" "-c" "sleep 1 && /usr/libexec/polkit-mate-authentication-agent-1"
94 spawn-at-startup "sh" "-c" "bash ~/.config/scripts/niri/wallpaper_restore.sh"95 spawn-at-startup "sh" "-c" "bash ~/.config/scripts/niri/wallpaper_restore.sh"
95 spawn-at-startup "sh" "-c" "bash ~/.config/scripts/shared/song_detail_writer.sh"96 spawn-at-startup "sh" "-c" "bash ~/.config/scripts/shared/song_detail_writer.sh"
96 spawn-at-startup "sh" "-c" "sleep 1 && waybar -c ~/.config/waybar/config-niri"97 spawn-at-startup "sh" "-c" "sleep 1 && waybar -c ~/.config/waybar/config-niri"
@@ -109,8 +110,13 @@ animations {
109 }110 }
110 111
111 window-rule {112 window-rule {
112- draw-border-with-background false113+ // background fill in border color: the border's inner AA edge and the app's
113- geometry-corner-radius 12114+ // corner AA edge share a line; without the fill the backdrop bleeds through
115+ // that seam. Transparent apps opt back out per-rule (wezterm below).
116+ draw-border-with-background true
117+ // libadwaita 1.6+ draws 15; must stay >= the largest toolkit radius so
118+ // clip-to-geometry dominates and the border hugs every corner. 16 = 1px margin.
119+ geometry-corner-radius 16
114 clip-to-geometry true120 clip-to-geometry true
115 }121 }
116 122
.config/scripts/niri/wallpaper_picker.shmodified+4 -3
@@ -14,16 +14,17 @@ for thumb in "$THUMB_DIR"/*.png; do
14 fi14 fi
15 done15 done
16 16
17-find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | while read -r img; do17+find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' -o -iname '*.gif' \) | while read -r img; do
18 name=$(basename "$img")18 name=$(basename "$img")
19 thumb="$THUMB_DIR/$name.png"19 thumb="$THUMB_DIR/$name.png"
20 if [ ! -f "$thumb" ] || [ "$img" -nt "$thumb" ]; then20 if [ ! -f "$thumb" ] || [ "$img" -nt "$thumb" ]; then
21- magick "$img" -thumbnail 128x80 "$thumb" &21+ # [0] = first frame only; without it animated gifs expand into one PNG per frame
22+ magick "${img}[0]" -thumbnail 128x80 "$thumb" &
22 fi23 fi
23 done24 done
24 wait25 wait
25 26
26-SELECTED=$(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | sort | while read -r img; do27+SELECTED=$(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' -o -iname '*.gif' \) | sort | while read -r img; do
27 name=$(basename "$img")28 name=$(basename "$img")
28 echo -en "${name}\0icon\x1f${THUMB_DIR}/${name}.png\n"29 echo -en "${name}\0icon\x1f${THUMB_DIR}/${name}.png\n"
29 done | rofi -dmenu -p "Wallpaper" -i -show-icons \30 done | rofi -dmenu -p "Wallpaper" -i -show-icons \
.config/scripts/niri/wallpaper_restore.shmodified+1 -1
@@ -23,7 +23,7 @@ if [ ! -f "$WALLPAPER" ]; then
23 fi23 fi
24 24
25 if [ ! -f "$WALLPAPER" ]; then25 if [ ! -f "$WALLPAPER" ]; then
26- WALLPAPER=$(find "$FALLBACK_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | sort | head -1)26+ WALLPAPER=$(find "$FALLBACK_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' -o -iname '*.gif' \) | sort | head -1)
27 fi27 fi
28 28
29 if [ -f "$WALLPAPER" ]; then29 if [ -f "$WALLPAPER" ]; then
.config/scripts/niri/workspace_nav.shmodified+17 -2
@@ -61,7 +61,14 @@ focus | move)
61 ;;61 ;;
62 next | move-next)62 next | move-next)
63 if [ "$pos" -lt 0 ]; then63 if [ "$pos" -lt 0 ]; then
64- target="${plain[0]}"64+ # on a named workspace: nearest unnamed one below it
65+ for idx in "${plain[@]}"; do
66+ if [ "$idx" -gt "$current_idx" ]; then
67+ target="$idx"
68+ break
69+ fi
70+ done
71+ [ -n "$target" ] || exit 0
65 else72 else
66 i=$((pos + 1))73 i=$((pos + 1))
67 [ "$i" -ge "${#plain[@]}" ] && i=$((${#plain[@]} - 1))74 [ "$i" -ge "${#plain[@]}" ] && i=$((${#plain[@]} - 1))
@@ -70,7 +77,15 @@ next | move-next)
70 ;;77 ;;
71 prev | move-prev)78 prev | move-prev)
72 if [ "$pos" -lt 0 ]; then79 if [ "$pos" -lt 0 ]; then
73- target="${plain[0]}"80+ # on a named workspace: nearest unnamed one above it
81+ for idx in "${plain[@]}"; do
82+ if [ "$idx" -lt "$current_idx" ]; then
83+ target="$idx"
84+ else
85+ break
86+ fi
87+ done
88+ [ -n "$target" ] || exit 0
74 else89 else
75 i=$((pos - 1))90 i=$((pos - 1))
76 [ "$i" -lt 0 ] && i=091 [ "$i" -lt 0 ] && i=0