Module: Notifier::NotifySend

Extended by:
NotifySend
Included in:
NotifySend
Defined in:
lib/notifier/notify_send.rb

Instance Method Summary collapse

Instance Method Details

#notify(options) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/notifier/notify_send.rb', line 9

def notify(options)
  command = [
    "notify-send", "-i",
    options[:image],
    options[:title],
    options[:message]
  ]

  Thread.new { system(*command) }
end

#supported?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/notifier/notify_send.rb', line 5

def supported?
  RUBY_PLATFORM =~ /(linux|freebsd)/ && `which notify-send > /dev/null` && $? == 0
end