4
Loads a pixbuf from a file, and sends it as data in a notification.
12
SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
13
ICON_PATH = os.path.join(SCRIPT_PATH, "..", "icons")
17
icon = os.path.join(ICON_PATH, "recent-notifications.svg")
19
icon = os.path.join(ICON_PATH, sys.argv[1])
21
if not pynotify.init("test_pixbuf"):
22
print "Failed to initialize notifications."
25
n = pynotify.Notification("TestPixbuf",
26
"This is a test, this is only a test.")
28
pixbuf = gtk.gdk.pixbuf_new_from_file(icon)
30
n.set_icon_from_pixbuf(pixbuf)
33
print "Failed to send notification."
36
if __name__ == "__main__":