I'm writing a shell script from which I'd like to display a desktop notification which stays in one corner of the display until the user clicks on it, and if multiple notifications are sent, then all of them are displayed and visible at the same time in one on the screen. I've tried notify-send, which worked perfectly on Ubuntu Hardy, but it cannot do what I need on Ubuntu Lucid. What should I use instead?

I've also tried pynotify (python-notify) and libnotify, but they all seem to use the same backend, which cannot do what I want by default.

I've tried

$ notify-send foo

, but it displays a notification which times out after a few second (not good), and

$ notify-send -t 0 foo

displays a notification in a window in the middle of the screen (not good). If I do

$ notify-send foo
$ notify-send bar

only one of the notifications are displayed at the same time (not good).

After some more digging I've found:

link|improve this question

65% accept rate
feedback

3 Answers

up vote 3 down vote accepted

It seems that notify-osd is the new Ubuntu notification daemon which can't do what I want, and notification-daemon is the one I need, the one which was the default in previous Ubuntu versions like Hardy. Here is how to install it and make it the default on Ubuntu Lucid:

$ sudo apt-get install notification-daemon
$ sudo perl -pi -e 's@^Exec=.*@Exec=/usr/lib/notification-daemon/notification-daemon@' /usr/share/dbus-1/services/org.freedesktop.Notifications.service
$ sudo killall notify-osd

Optional:

$ sudo rm -f /usr/share/dbus-1/services/org.freedesktop.Notifications.service.*

Now this works as intended:

$ notify-send -t 0 foo
link|improve this answer
1  
How does this fix affect other apps? – Matti Pastell Dec 14 '10 at 14:59
All apps would send their notification to notification-daemon. – pts Jan 9 '11 at 17:42
feedback

There is a patched version of libnotify-osd that might help you http://www.webupd8.org/2010/07/patched-notifyosd-updates-option-to.html

link|improve this answer
Correct me if I'm wrong, but Zenity is unable to display a desktop notification in the corner of the screen, and then display the second notification next to the first one so they won't overlap. So what you suggested (Zenity) cannot do what I need. – pts Dec 14 '10 at 14:40
You're right, sorry I read it too quickly. I've changed the answer. – Matti Pastell Dec 14 '10 at 14:49
Thanks for digging up the webupd8 link. Unfortunately, it doesn't solve any of my problems, it doesn't provide any customizations I need. – pts Dec 14 '10 at 14:57
feedback

perhaps you want to

apt-get install libnotify-bin

link|improve this answer
The only binary libnotify-bin contains is notify-send, and my question already contains that this doesn't do what I want. Moreover, I've already mentioned that libnotify doesn't do what I want with the default settings and the default backend. If you have any idea how to make it work, please let me know. – pts Dec 14 '10 at 13:51
1  
I think the problem is then to adjust the backend of notify-send... I guess maybe you want something like this: webupd8.org/2010/05/finally-easy-way-to-customize-notify.html? – bubu Dec 14 '10 at 14:05
Thanks for the link, it's informative. I agree that adjusting the backend is the way to go -- but how? Your link on webupd8.org doesn't solve any of my problems, it doesn't provide any customizations I need. – pts Dec 14 '10 at 14:35
feedback

Your Answer

 
or
required, but never shown

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