summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-22 11:27:21 +0200
committerhut <hut@lavabit.com>2010-06-22 11:27:21 +0200
commitbf14a7e72e7c03673949388365744f26e227ec83 (patch)
treee2a659ad39e963a1c6c372f6a55fb7be0dab241d /ranger
parent2e386864912dd028774ffcd997f5ea686e955d0b (diff)
downloadranger-bf14a7e72e7c03673949388365744f26e227ec83.tar.gz
data/scope.sh: added lynx
Diffstat (limited to 'ranger')
-rwxr-xr-xranger/data/scope.sh22
1 files changed, 15 insertions, 7 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index ad14f5e5..ef5f8ff4 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -13,19 +13,27 @@
 mimetype=$(file --mime-type -Lb "$1")
 extension=$(echo "$1" | grep '\.' | grep -o '[^.]\+$')
 
+case "$extension" in
+	# Archive extensions:
+	tar|gz|tgz|bz|tbz|bz2|tbz2|Z|tZ|lzo|tzo|lz|tlz|xz|txz|7z|t7z|\
+	zip|jar|war|rar|lha|lzh|alz|ace|a|arj|arc|rpm|cab|lzma|rz|cpio)
+		atool -l "$1" || exit 1
+		exit 0;;
+	# HTML Pages:
+	htm|html|xhtml)
+		lynx -dump "$1" || elinks -dump "$1" || exit 1
+		exit 0;;
+esac
+
 case "$mimetype" in
-	text/*)
+	# Syntax highlight for text files:
+	text/* | */xml)
 		highlight --ansi "$1" || cat "$1" || exit 1
 		exit 0;;
+	# Ascii-previews of images:
 	image/*)
 		img2txt "$1" || exit 1
 		exit 0;;
 esac
 
-case "$extension" in
-	zip|gz)
-		atool -l "$1" || exit 1
-		exit 0;;
-esac
-
 exit 1