Module: Notifier::Kdialog

Extended by:
Kdialog
Included in:
Kdialog
Defined in:
lib/notifier/kdialog.rb

Instance Method Summary collapse

Instance Method Details

#notify(options) ⇒ Object


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

def notify(options)
  command = [
    "kdialog",
    "--title", options[:title].to_s,
    "--passivepopup", options[:message].to_s,
    "5"
  ]

  Thread.new { system(*command) }.join
end

#supported?Boolean

Returns:

  • (Boolean)

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

def supported?
  Notifier.os?(/(linux|freebsd)/) && `which kdialog > /dev/null` && $? == 0
end