From ff725e2b7fd85ab4c37a1fa401823d99e5ac7f70 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 12 Oct 2010 21:29:33 +0200 Subject: data/scope: added mediainfo --- ranger/data/scope.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 30ae18ea..66b52d23 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -36,6 +36,7 @@ case "$extension" in rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip) atool -l "$path" | head -n $maxln && exit 3 exit 1;; + # PDF documents: pdf) pdftotext -q "$path" - | head -n $maxln && exit 3 exit 1;; @@ -54,6 +55,11 @@ case "$mimetype" in # Ascii-previews of images: image/*) img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; + # Display information about media files: + video/* | audio/*) + # Use sed to remove spaces so the output fits into the narrow window + have mediainfo && mediainfo "$path" | sed 's/ \+:/: /;' && + exit 5 || exit 1; esac exit 1 -- cgit 1.4.1-2-gfad0