Module: Notifier::Knotify

Extended by:
Knotify
Included in:
Knotify
Defined in:
lib/notifier/knotify.rb

Instance Method Summary collapse

Instance Method Details

#notify(options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/notifier/knotify.rb', line 13

def notify(options)
  command = [
    "dcop",
    "knotify",
    "default",
    "notify",
    "eventname",
    options[:title].to_s,
    options[:message].to_s,
    "",
    "",
    "16",
    "2"
  ]

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

#supported?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/notifier/knotify.rb', line 7

def supported?
  Notifier.os?(/(linux|freebsd)/) &&
    `ps -Al | grep dcop` &&
    $CHILD_STATUS == 0
end