You are not logged in.
I have recently begun using ranger on i3. I have enbled previews in my scope.sh (which I had help setting up).
mp3 files display a mediainfo preview. m4a files however display the contents of embedded artwork.
I want to get a mediainfo preview of my m4a audio files. here is that section of my scope.sh:
case "$mimetype" in
# Syntax highlight for text files:
text/* | */xml)
if [ "$(tput colors)" -ge 256 ]; then
pygmentize_format=terminal256
highlight_format=xterm256
else
pygmentize_format=terminal
highlight_format=ansi
fi
try safepipe highlight --out-format=${highlight_format} "$path" && { dump | trim; exit 5; }
try safepipe pygmentize -f ${pygmentize_format} "$path" && { dump | trim; exit 5; }
exit 2;;
# Ascii-previews of images:
image/*)
img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;
# Display information about media files:
video/* | audio/*)
exiftool "$path" && exit 5
# Use sed to remove spaces so the output fits into the narrow window
try mediainfo "$path" && { dump | trim | sed 's/ \+:/: /;'; exit 5; } || exit 1;;
esac
exit 1It seems the output of
file --mime-type *.m4ais 'video/mp4', and that is the issue. Suggestions?
Last edited by shoelesshunter (2020-10-27 23:14:49)
Offline
Split audio/* and video/*, don't run exiftool on audio or drop exiftool altogether? Seems more interesting to be used on images (camera photos)
Offline