Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c085682cda
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (17 sloc) 0.499 kb
module Notify
# Display a message through Growl.
def self.send(title, message, icon, priority=0)
icon = File.join(File.dirname(__FILE__), 'img', "#{icon}.png") unless File.exists?(icon) # Phew.
# Translate the priority
case priority
when 0,1
pri = 'normal'
when 2
pri = 'critical'
else
pri = 'low'
end
system 'notify-send', '-i', File.expand_path(icon), '-u', pri, title, message
puts "[#{Time.now.to_s}] #{title}", message
end
end
Jump to Line
Something went wrong with that request. Please try again.