config: pin mpv hwdec to vaapi, plus in-flight niri work
Browse files at this commit3d603382bce08138d01fb0ca639f77e229b7876eParent: 377311f5 changed files +41 -9
- .config/mpv/mpv.conf +10 -0
- .config/niri/config.kdl +9 -3
- .config/scripts/niri/wallpaper_picker.sh +4 -3
- .config/scripts/niri/wallpaper_restore.sh +1 -1
- .config/scripts/niri/workspace_nav.sh +17 -2
.config/mpv/mpv.confmodified+10 -0
| @@ -2,6 +2,16 @@ asc=no | |||
| 2 | ao=alsa | 2 | ao=alsa |
| 3 | audio-device=alsa/pipewire | 3 | 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 at | 15 | # 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 OSC | 17 | # 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 2 | 78 | + width 3 |
| 79 | 79 | ||
| 80 | // WALLUST-GRADIENT | 80 | // 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 false | 113 | + // background fill in border color: the border's inner AA edge and the app's |
| 113 | - geometry-corner-radius 12 | 114 | + // 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 true | 120 | 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 | fi | 14 | fi |
| 15 | done | 15 | 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; do | 17 | +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" ]; then | 20 | 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 | fi | 23 | fi |
| 23 | done | 24 | done |
| 24 | wait | 25 | 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; do | 27 | +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 | fi | 23 | fi |
| 24 | 24 | ||
| 25 | if [ ! -f "$WALLPAPER" ]; then | 25 | 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 | fi | 27 | fi |
| 28 | 28 | ||
| 29 | if [ -f "$WALLPAPER" ]; then | 29 | 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 ]; then | 63 | 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 | else | 72 | 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 ]; then | 79 | 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 | else | 89 | else |
| 75 | i=$((pos - 1)) | 90 | i=$((pos - 1)) |
| 76 | [ "$i" -lt 0 ] && i=0 | 91 | [ "$i" -lt 0 ] && i=0 |