Skip to content

Instantly share code, notes, and snippets.

@baron
Forked from yhara/rb_growlnotify
Created October 25, 2009 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baron/217842 to your computer and use it in GitHub Desktop.
Save baron/217842 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