nix

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

commit 84eb5a4dca041fe1fa6e551cdd859aa18a819bb1
parent 132f5cb081d63146bf0710de850e34167629a220
Author: mtmn <miro@haravara.org>
Date:   Fri,  8 May 2026 16:23:36 +0200

bin: add `showcover` to show cover art in terminal

Diffstat:
Amodules/mixins/dotfiles/bin/showcover | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/modules/mixins/dotfiles/bin/showcover b/modules/mixins/dotfiles/bin/showcover @@ -0,0 +1,18 @@ +#!/bin/bash +# Show cover art from an audio file + +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 + +coverfile="$tmpdir/cover.${imgext}" +ffmpeg -nostdin -y -i "$file" -an -vcodec copy "$coverfile" 2>/dev/null + +chafa "$coverfile"