about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-10-12 21:29:33 +0200
committerhut <hut@lavabit.com>2010-10-12 21:29:33 +0200
commitff725e2b7fd85ab4c37a1fa401823d99e5ac7f70 (patch)
treef3aeb5bd00e09d40d8304946bf7f5154f706416d /ranger
parent0d8898f1d3eb22baf39911dad9715de2de793b57 (diff)
downloadranger-ff725e2b7fd85ab4c37a1fa401823d99e5ac7f70.tar.gz
data/scope: added mediainfo
Diffstat (limited to 'ranger')
-rwxr-xr-xranger/data/scope.sh6
1 files changed, 6 insertions, 0 deletions
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