Skip to content

Instantly share code, notes, and snippets.

@yhara
Created December 11, 2008 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yhara/34707 to your computer and use it in GitHub Desktop.
Save yhara/34707 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'optparse'
require 'rubygems'
require 'meow'
def usage!
puts $opt
exit
end
message = ""
meow_opts = {}
$opt = OptionParser.new{|o|
o.on("-n FOO"){}
o.on("-H HOST"){}
o.on("-h", "--help"){ usage! }
o.on("--image IMG"){|img| meow_opts[:icon] = img }
o.on("-p PRIORITY"){|pri| meow_opts[:priority] = pri.to_i }
o.on("-m MESSAGE"){|msg| message = msg }
o.on("-s", "--sticky"){ meow_opts[:sticky] = true }
}
$opt.parse!(ARGV)
if ARGV.empty?
title = $0
else
title = ARGV.join(" ")
end
growl = Meow.new("rb_growlnotify")
growl.notify(title, message, meow_opts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment