views:

67

answers:

2

If I run the following in python in Ubuntu 10.04:

>>> import pynotify
>>> p = pynotify.Notification ("Notice","","/home/george/Pictures/test.png")
>>> p.show()
true

The message displays as expected, except the image does not appear in the OSD. How can I display a local image?

In fact, for what I need, it would be better if I could display a remote image. (via HTTP)

How can I do that?

A: 

That works for me. Maybe your backend doesn't support icons, or you are not noticing. For KDE 4, it's small but definitely there in the upper-left. Also, I don't think there's any pynotify support for remote images, so use:

urllib.urlretrieve("http://some/remote/file.png", "/some/local/file.png")

as needed.

Matthew Flaschen
Okay... that will work fine, thanks!
George Edison
+3  A: 

The following definitely works for me:

>>> import pynotify
>>> p = pynotify.Notification("Notice", "", "/usr/share/pixmaps/firefox.png")
>>> p.show()

alt text

Are you sure the image is there? With correct permissions?

Pascal Thivent
It is working now... I guess there was a problem with the particular image I was testing. Thanks!
George Edison