Command line Gnome Notification 1

Posted by Kerry Mon, 10 Mar 2008 21:38:00 GMT

From the “it’s almost certainly been done better somewhere else” department, here is my script to fire off a Gnome Notification after a shell command finishes.

a python script:

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

def notify(message=""):
    n = Notification("Command Line Completed", message)
    n.show()

init("cli notify")
if len(sys.argv) > 1:
    notify(sys.argv[1])
else:
    notify()

Then just add it to your path and you can append it onto some command:

echo monkey && mynotify.py "some message"

You then get a notification like so:

image

Gnome Development Forums

Posted by Kerry Sun, 26 Feb 2006 12:08:00 GMT

GnomeDev.com

A new forum for all things related to Gnome development. Will be interesting to see if it gains much traction. There isn’t much content on there right now, but there are some pointers to tutorials and things for developing in Gnome.