Class: Cadre::Libnotify::Notifier
- Defined in:
- lib/cadre/libnotify/notifier.rb
Instance Attribute Summary
Attributes inherited from Notifier
#app_name, #expire_time, #message, #sound, #summary, #transient
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Notifier
#available?, availables, get, #initialize, register, registry
Constructor Details
This class inherits a constructor from Cadre::Notifier
Class Method Details
.available? ⇒ Boolean
8 9 10 |
# File 'lib/cadre/libnotify/notifier.rb', line 8 def self.available? return availables["notify-send"] end |
Instance Method Details
#go ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cadre/libnotify/notifier.rb', line 12 def go cmd = "notify-send #{} \"#@summary\" \"#@message\"" %x[#{cmd}] if available?("paplay") %x[paplay #{Valise.find(["sounds", sound]).full_path}] if String === sound elsif available?("aplay") %x[aplay #{Valise.find(["sounds", sound]).full_path}] if String === sound end end |
#options ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/cadre/libnotify/notifier.rb', line 23 def = [] unless expire_time.nil? << "-t #@expire_time" end if transient << "-h \"byte:transient:1\"" end unless app_name.nil? << "-a #@app_name" end .join(" ") end |