diff --git a/.config/mpv/mpv.conf b/.config/mpv/mpv.conf index a0ed910..2b364c9 100644 --- a/.config/mpv/mpv.conf +++ b/.config/mpv/mpv.conf @@ -2,6 +2,16 @@ asc=no ao=alsa audio-device=alsa/pipewire +# GPU decode via VA-API on the RX 9060 XT (gfx1200/VCN 5.0): h264, hevc +# (incl. Main10), vp9 (incl. profile2) and av1 all decode in hardware. +# +# Pinned to vaapi rather than auto-safe on purpose. auto-safe prefers Vulkan +# Video, and radv's AV1 decode hangs the VCN block on this card — every AV1 +# file faults with VK_ERROR_DEVICE_LOST and the kernel has to reset +# vcn_unified_0 to recover. vaapi decodes the same files cleanly. Retry +# auto-safe after a Mesa bump; if AV1 plays, the pin can be dropped. +hwdec=vaapi + # Let the compositor own the window size. Without this mpv keeps the window at # the video's aspect ratio, deriving height from whatever width it is given — # under niri that makes the window taller than its tile and pushes the OSC diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl index 0ed2e89..31cde2d 100644 --- a/.config/niri/config.kdl +++ b/.config/niri/config.kdl @@ -75,7 +75,7 @@ layout { } border { - width 2 + width 3 // WALLUST-GRADIENT active-gradient from="#4D0830" to="#7E420A" angle=90 in="oklch" @@ -91,6 +91,7 @@ environment { XCURSOR_SIZE "24" } +spawn-at-startup "sh" "-c" "sleep 1 && /usr/libexec/polkit-mate-authentication-agent-1" spawn-at-startup "sh" "-c" "bash ~/.config/scripts/niri/wallpaper_restore.sh" spawn-at-startup "sh" "-c" "bash ~/.config/scripts/shared/song_detail_writer.sh" spawn-at-startup "sh" "-c" "sleep 1 && waybar -c ~/.config/waybar/config-niri" @@ -109,8 +110,13 @@ animations { } window-rule { - draw-border-with-background false - geometry-corner-radius 12 + // background fill in border color: the border's inner AA edge and the app's + // corner AA edge share a line; without the fill the backdrop bleeds through + // that seam. Transparent apps opt back out per-rule (wezterm below). + draw-border-with-background true + // libadwaita 1.6+ draws 15; must stay >= the largest toolkit radius so + // clip-to-geometry dominates and the border hugs every corner. 16 = 1px margin. + geometry-corner-radius 16 clip-to-geometry true } diff --git a/.config/scripts/niri/wallpaper_picker.sh b/.config/scripts/niri/wallpaper_picker.sh index 0de2d43..2b0b5b1 100755 --- a/.config/scripts/niri/wallpaper_picker.sh +++ b/.config/scripts/niri/wallpaper_picker.sh @@ -14,16 +14,17 @@ for thumb in "$THUMB_DIR"/*.png; do fi done -find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | while read -r img; do +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 name=$(basename "$img") thumb="$THUMB_DIR/$name.png" if [ ! -f "$thumb" ] || [ "$img" -nt "$thumb" ]; then - magick "$img" -thumbnail 128x80 "$thumb" & + # [0] = first frame only; without it animated gifs expand into one PNG per frame + magick "${img}[0]" -thumbnail 128x80 "$thumb" & fi done wait -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 +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 name=$(basename "$img") echo -en "${name}\0icon\x1f${THUMB_DIR}/${name}.png\n" done | rofi -dmenu -p "Wallpaper" -i -show-icons \ diff --git a/.config/scripts/niri/wallpaper_restore.sh b/.config/scripts/niri/wallpaper_restore.sh index 436051b..884e4b0 100755 --- a/.config/scripts/niri/wallpaper_restore.sh +++ b/.config/scripts/niri/wallpaper_restore.sh @@ -23,7 +23,7 @@ if [ ! -f "$WALLPAPER" ]; then fi if [ ! -f "$WALLPAPER" ]; then - WALLPAPER=$(find "$FALLBACK_DIR" -maxdepth 1 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.webp' \) | sort | head -1) + 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) fi if [ -f "$WALLPAPER" ]; then diff --git a/.config/scripts/niri/workspace_nav.sh b/.config/scripts/niri/workspace_nav.sh index 457e0f4..5479866 100755 --- a/.config/scripts/niri/workspace_nav.sh +++ b/.config/scripts/niri/workspace_nav.sh @@ -61,7 +61,14 @@ focus | move) ;; next | move-next) if [ "$pos" -lt 0 ]; then - target="${plain[0]}" + # on a named workspace: nearest unnamed one below it + for idx in "${plain[@]}"; do + if [ "$idx" -gt "$current_idx" ]; then + target="$idx" + break + fi + done + [ -n "$target" ] || exit 0 else i=$((pos + 1)) [ "$i" -ge "${#plain[@]}" ] && i=$((${#plain[@]} - 1)) @@ -70,7 +77,15 @@ next | move-next) ;; prev | move-prev) if [ "$pos" -lt 0 ]; then - target="${plain[0]}" + # on a named workspace: nearest unnamed one above it + for idx in "${plain[@]}"; do + if [ "$idx" -lt "$current_idx" ]; then + target="$idx" + else + break + fi + done + [ -n "$target" ] || exit 0 else i=$((pos - 1)) [ "$i" -lt 0 ] && i=0