summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSergey Mironov <ierton@gmail.com>2010-09-19 18:38:13 +0400
committerhut <hut@lavabit.com>2010-09-23 10:53:38 +0200
commit6eb852241bb060f0cbef1f3cac261f4eb544d046 (patch)
tree3cbdafd3de96ee5661393d19194e187ee61a487f
parent0ea6c566f1b3dd7c8e5471651ebbe68a53d01de6 (diff)
downloadranger-6eb852241bb060f0cbef1f3cac261f4eb544d046.tar.gz
apps.py Add mimeopen support
mimeopen [1] expects the freedesktop mime database and implements simple
console unterface to query it. In its basic mode mimeopen behaves like
xdg-open.

[1] - http://search.cpan.org/dist/File-MimeInfo
-rw-r--r--ranger/defaults/apps.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py
index 47eff0c9..061d2e0b 100644
--- a/ranger/defaults/apps.py
+++ b/ranger/defaults/apps.py
@@ -181,6 +181,14 @@ class CustomApplications(Applications):
 		if c.mode is 1:
 			return tup("totem", "--fullscreen", *c)
 
+	@depends_on('mimeopen')
+	def app_mimeopen(self, c):
+		if c.mode is 0:
+			return tup("mimeopen", *c)
+		if c.mode is 1: 
+			# Will ask user to select program
+			# aka "Open with..."
+			return tup("mimeopen", "--ask", *c)
 
 # Often a programs invocation is trivial.  For example:
 #    vim test.py readme.txt [...]