pythonubuntupynotify

How to get pynotify to display line breaks and HTML?


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>?


Solution

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

    >>> n = pynotify.Notification("summary", "body\n next line", "dialog-warning")
    >>> n.show()