views:

26

answers:

1

How can I make pynotify display line breaks and HTML in the notifications?

Here is what I got:

>>> import pynotify
>>> n = pynotify.Notification ("This is a test.\n\nAnd this too!",
                               "","notification-message-im")
>>> n.show()

Contrary to what is expected, there is no line-break between the two sentences. (At least not on Ubuntu 10.04)

Also, is there a way to include simple HTML in the notifications, like <b>, <br>, or <i>?

+1  A: 

You can use '\n' in message body but not in summary.

>>> n = pynotify.Notification("summary", "body\n next line", "dialog-warning")
>>> n.show()
zoli2k
Ah. Thank you - perfect.
George Edison