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?

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
Nathan Osman
  • 71,149
  • 71
  • 256
  • 361

2 Answers2

4

The following definitely works for me:

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

alt text http://www.imagebanana.com/img/qfmebkr5/screenshot_009.png

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

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
1

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
  • 278,309
  • 50
  • 514
  • 539