Created
April 10, 2014 14:21
-
-
Save raa0121/10387575 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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