Python system tray notifications in Linux

As a follow up to my previous post, here’s how to accomplish system tray notifications in ubuntu linux and family. I must say, compared to windows, this is child’s play… under ten lines of code!

#!/usr/bin/python
import sys
import pynotify

if __name__ == ‘__main__’:
if not pynotify.init (“summary-body”):
sys.exit (1)

  1. try the summary-body case

n = pynotify.Notification (“Cloudlink”,
“Hello Brian🙂 “)
n.show ()

 

This results in something like this (under linux mint – top right corner):

Screenshot from 2013-10-19 12:49:46

A full, more involved example can be found here