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)

# 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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s