Sha256: 4718277cf105d207e0f7f03bc7616158d144580a651e0f0c4fb66019f7b84cf8

Contents?: true

Size: 392 Bytes

Versions: 3

Compression:

Stored size: 392 Bytes

Contents

module Notifier
  module Knotify
    extend self

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
notifier-0.2.0 lib/notifier/knotify.rb
notifier-0.1.5 lib/notifier/knotify.rb
notifier-0.1.4 lib/notifier/knotify.rb