#!/usr/bin/env python

# taken from
# http://blogs.divisibleprime.com/ronin/articles/2008/03/10/command-line-gnome-notification

def gnome(arg):
    import pynotify
    import sys
    
    def notify(message=""):
        n = pynotify.Notification("Paintown", message)
        n.show()
    
    pynotify.init("cli notify")
    notify(arg)

def kde(arg):
    import os
    os.system("kdialog --title 'Paintown' --passivepopup '%s' 2" % arg)

arg = ""
import sys
if len(sys.argv) > 1:
    arg = sys.argv[1]
try:
    gnome(arg)
except:
    kde(arg)
