Class: Knj::Notify

Inherits:
Object show all
Defined in:
lib/knj/notify.rb

Class Method Summary collapse

Class Method Details

.send(args) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/knj/notify.rb', line 2

def self.send(args)
  cmd = "notify-send"
  
  if args["time"]
    raise "Time is not numeric." if !Php.is_numeric(args["time"])
    cmd << " -t " + args["time"].to_s
  end
  
  cmd << " " + Strings.UnixSafe(args["title"]) + " " + Strings.UnixSafe(args["msg"])
  system(cmd)
end