Sha256: 612b15f773a18b87b8d5829420b492b14be213e531985c9c9d715d8aa7aa17a5

Contents?: true

Size: 404 Bytes

Versions: 2

Compression:

Stored size: 404 Bytes

Contents

module Notifier
  module Knotify
    extend self

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

    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
notifier-0.5.2 lib/notifier/knotify.rb
notifier-0.5.1 lib/notifier/knotify.rb