views:

223

answers:

2

I am using pynotify and this is the code I am trying to get to work:

#! /usr/bin/python
try:
    import pynotify
    if pynotify.init("Telebrama Alert"):
        n = pynotify.Notification('Message','This is test message')
        n.set_urgency(pynotify.URGENCY_CRITICAL)
        n.show()
    else:
        print 'There was a problem in initializing the pynotify module'
except:
    print "you don't seem to installed pynotify\n"

It is working fine on my computer. But I want to send some notification to another network. How can I make it work?

+1  A: 

pynotify is just an X client. To connect non-local X server you have to set DISPLAY environment variable. Note, that X server you are going to connect to should be configured to accept remote connections (see man pages for xhost and xauth).

Denis Otkidach
I understood he wanted to launch his program on one desktop to send notification on others, but you may be right it could be just for remote X.
kriss
than u for u r help
rajaneesh
+1  A: 

Well you should understand pynotify is not about network.

pynotify is the Python binding for libnotify. libnotify is about desktop (local) notification. It uses the local D-Bus message bus. No network. So if you want to send a notification to another desktop you will have to use some other tool.

kriss
do u know any other tool which act as a same thing
rajaneesh