Module: Notifier::Hud
Instance Method Summary collapse
Instance Method Details
#hud_bin ⇒ Object
11 12 13 14 15 16 |
# File 'lib/notifier/hud.rb', line 11 def hud_bin @hud_bin ||= [ "/Applications/hud.app/Contents/MacOS/cli", File.("~/Applications/hud.app/Contents/MacOS/cli") ].find {|path| File.file?(path) } end |
#notify(options) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/notifier/hud.rb', line 18 def notify() [:image] ||= "apple.terminal" command = [ hud_bin, "--title", [:title].to_s, "--message", [:message].to_s, "--symbol-name", [:image].to_s ] Thread.new { system(*command) }.join end |
#supported? ⇒ Boolean
7 8 9 |
# File 'lib/notifier/hud.rb', line 7 def supported? Notifier.os?(/darwin/) && hud_bin end |