Skip to content

Instantly share code, notes, and snippets.

@raa0121
Created April 10, 2014 14:21
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 raa0121/10387575 to your computer and use it in GitHub Desktop.
Save raa0121/10387575 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
from gntp.notifier from GrowlNotifer
def notify(title, message, icon):
n = pynotify.Notification(title, message)
if len(icon) > 0:
f = urllib.urlopen(icon)
data = f.read()
pbl = gtk.gdk.PixbufLoader()
pbl.write(data)
pbuf = pbl.get_pixbuf()
pbl.close()
n.set_icon_from_pixbuf(pbuf)
n.show
notify(
sys.argv[1],
sys.argv[2],
sys.argv[3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment