Sha256: b8988bffe3dd8cf5ac5e12a730ebfd3686b72d17076350cb3bc68cad17716673

Contents?: true

Size: 372 Bytes

Versions: 3

Compression:

Stored size: 372 Bytes

Contents

module Notifier
  module Kdialog
    extend self

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

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

      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/kdialog.rb
notifier-0.1.5 lib/notifier/kdialog.rb
notifier-0.1.4 lib/notifier/kdialog.rb