Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've written a program that uses Notify-OSD but occasionally messages from my app will stack up in the queue. I've read about Notify-OSD merging However, it doesn't do this automatically - how can I get my application to merge notifications so they don't stream in one at a time?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can concatenate related notifications bubbles by setting the hint string x-canonical-append to true.

from gi.repository import Notify
Notify.init('test')

n = Notify.Notification.new('Summary', 'Line 1', 'dialog-information')
n.set_hint_string('x-canonical-append', 'true')
n.show()

n = Notify.Notification.new('Summary', 'Line 2', 'dialog-information')
n.set_hint_string('x-canonical-append', 'true')
n.show()

For more details see append-hint-python.py python example at http://bazaar.launchpad.net/~indicator-applet-developers/notify-osd/trunk/view/head:/examples/append-hint-example.py

Source: http://developer.ubuntu.com/resources/technologies/notification/#Concatenating_related_notification_bubbles

share|improve this answer

If you are developing in python use the update method of the notification object then the show method:

notification = pynotify.Notification("title", "body", "icon")
notification.show()
#later
notification.update("title2", "body2", "icon2")
notification.show()

If you are developing in C, there is the notify_notification_update() function that does the same thing. Other languages will be similar but the naming may be slightly different.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.