diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/apps.rb | 52 | ||||
-rw-r--r-- | data/types.rb | 19 |
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 |