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?
Asked
Active
Viewed 301 times
2 Answers
3
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.
dv3500ea
- 37,734
1
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
Giovanni
- 158