about summary refs log tree commit diff stats
path: root/data
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-06-13 04:12:18 +0200
committerhut <hut@lavabit.com>2009-06-13 04:12:18 +0200
commitbd627dc4f2d009642de3ada13cbdc547490baf68 (patch)
tree116e882dd0d303cd8999e1a83c47965ba4a9458b /data
parentf55eb9bf0d7d2c252a6591324bfd8392d30c53da (diff)
downloadranger-bd627dc4f2d009642de3ada13cbdc547490baf68.tar.gz
fixing & cleaning up
Diffstat (limited to 'data')
-rw-r--r--data/apps.rb52
-rw-r--r--data/types.rb19
2 files changed, 56 insertions, 15 deletions
diff --git a/data/apps.rb b/data/apps.rb
index dc65d1a7..1a9b65d0 100644
--- a/data/apps.rb
+++ b/data/apps.rb
@@ -2,16 +2,16 @@ module Application
 	def mplayer(rc)
 		check rc
 
-		rc.default_flags = 'd'
+		rc.base_flags = 'd'
 
-		if rc.no_mode?
-			rc.mode = (rc.name =~ /720p/) ? 2 : 1
-		end
+#		if rc.no_mode?
+#			rc.mode = (rc.name =~ /720p/) ? 2 : 1
+#		end
 
 		case rc.mode
-		when 1; "mplayer -fs -sid 0 #{~rc}"
-		when 2; "mplayer -sid 0 #{~rc}"
-		when 3; "mplayer -vm sdl -sid 0 #{~rc}"
+		when 0; "mplayer -fs -sid 0 #{~rc}"
+		when 1; "mplayer -sid 0 #{~rc}"
+		when 2; "mplayer -vm sdl -sid 0 #{~rc}"
 		else nil end
 	end
 
@@ -23,13 +23,13 @@ module Application
 	def feh(rc)
 		check rc
 		case rc.mode
-		when 4; "feh --bg-scale #{rc.one}"
-		when 5; "feh --bg-tile #{rc.one}"
-		when 6; "feh --bg-center #{rc.one}"
-		when 2; "gimp #{~rc}"
-		when 1; "feh -F #{~rc}"
-		else "feh #{~rc}"
-		end
+		when 0; "feh #{~rc}"
+		when 1; "feh --bg-scale #{rc.one}"
+		when 2; "feh --bg-tile #{rc.one}"
+		when 3; "feh --bg-center #{rc.one}"
+		when 4; "gimp #{~rc}"
+		when 5; "feh -F #{~rc}"
+		else nil end
 	end
 
 	def interpreted_language(rc)
@@ -54,5 +54,29 @@ module Application
 
 		"vi #{commands} #{~rc}"
 	end
+
+	def javac(rc)
+		"javac #{~rc}"
+	end
+
+	def java(rc)
+		"java #{rc.files.map{|x| ~x.before_last('.')}.join(' ')}"
+	end
+
+	def firefox(rc)
+		"firefox #{~rc}"
+	end
+
+	def make(rc)
+		case rc.mode
+		when 0; "make"
+		when 1; "make install"
+		when 2; "make clear"
+		else nil end
+	end
+	
+	def rake(rc)
+		"rake"
+	end
 end
 
diff --git a/data/types.rb b/data/types.rb
index 84f8295a..02c9cc1e 100644
--- a/data/types.rb
+++ b/data/types.rb
@@ -6,6 +6,14 @@ class Directory::Entry
 		## directories or sockets don't have any handler
 		use.no_handler if dir? or socket?
 
+		case @basename
+		when 'Makefile'
+			log "i use make"
+			use.make
+		when /^[Rr]akefile(.rb)?$/
+			use.rake
+		end
+
 		## at first, look at the mime type
 		case @mimetype
 		when /^video|audio/
@@ -17,9 +25,18 @@ class Directory::Entry
 		when /^image/
 			use.feh
 
-		when /^(text|application).x-(#{INTERPRETED_LANGUAGES.join('|')})$/
+		when /^(text|application)\/x-(#{INTERPRETED_LANGUAGES.join('|')})$/
 			use.interpreted_language
 
+		when 'text/x-java'
+			use.javac
+
+		when 'application/java-vm'
+			use.java
+
+		when 'text/html', 'application/x-shockwave-flash'
+			use.firefox
+
 		end
 
 		## second, look at the extension