nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

commit ac9eb107cfab668c0d6ffe3b8ccc26362230ee96
parent 84eb5a4dca041fe1fa6e551cdd859aa18a819bb1
Author: mtmn <miro@haravara.org>
Date:   Fri,  8 May 2026 16:25:55 +0200

chore: cleanup, showcover script

Diffstat:
Mhosts/void/overlays/config/shell/rc/void | 0
Mmodules/mixins/dotfiles/bin/rinit | 2+-
Mmodules/mixins/dotfiles/bin/showcover | 31+++++++++++++++++++------------
3 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/hosts/void/overlays/config/shell/rc/void b/hosts/void/overlays/config/shell/rc/void Binary files differ. diff --git a/modules/mixins/dotfiles/bin/rinit b/modules/mixins/dotfiles/bin/rinit @@ -3,7 +3,7 @@ export XDG_CURRENT_DESKTOP=river export XDG_SESSION_TYPE=wayland [ -e /run/opengl-driver ] || sudo ln -sfn \ - "$(grep -o '/nix/store/[^ ]*' /nix/store/*-non-nixos-gpu/lib/systemd/system/non-nixos-gpu.service)" \ + "$(grep -o '/nix/store/[^ ]*' /nix/store/*-non-nixos-gpu/lib/tmpfiles.d/non-nixos-gpu.conf)" \ /run/opengl-driver keychain --eval --ssh-agent-socket "$XDG_RUNTIME_DIR/ssh-agent.socket" diff --git a/modules/mixins/dotfiles/bin/showcover b/modules/mixins/dotfiles/bin/showcover @@ -1,18 +1,25 @@ -#!/bin/bash -# Show cover art from an audio file +#!/bin/sh +# Extract embedded cover images from all audio files in a directory +# recursively and browse them with nsxiv-rifle. +# Usage: showcover [directory] + +dir="${1:-.}" +[ ! -d "$dir" ] && { + echo "Not a directory: $dir" + exit 1 +} -file="$1" tmpdir=$(mktemp -d) trap 'rm -rf "$tmpdir"' EXIT -codec=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of csv=p=0 "$file" 2>/dev/null) - -case "$codec" in - png) imgext="png" ;; - *) imgext="jpg" ;; -esac +n=0 +find "$dir" -type f | while read -r f; do + ffmpeg -nostdin -y -i "$f" -an -vcodec copy "${tmpdir}/${n}.jpg" 2>/dev/null && n=$((n + 1)) +done -coverfile="$tmpdir/cover.${imgext}" -ffmpeg -nostdin -y -i "$file" -an -vcodec copy "$coverfile" 2>/dev/null +[ -z "$(ls "$tmpdir")" ] && { + echo "No cover images found" + exit 1 +} -chafa "$coverfile" +nsxiv-rifle "$tmpdir"