views:

314

answers:

1

Hi, I wrote a small app and I am using pynotify to show some messages to the user.

It all works fine here in arch, but when I tested it in Ubuntu, the behaviour was very weird.

Because of the way Ubuntu shows notifications (as what seems to be a rip of of growl), I can't click on them, or interact with them in any way, for that matter.

The biggest problem, however, is that it only shows one notification at a time, and has to wait (a long time, by default) untill one of them goes away to show the next one.

Given the nature of the little app I'm writing (a simple monitor that runs a command every time a file is changed), the results must appear to the user in real time.

I have tried to set a small timeout with message.set_timeout(), but Ubuntu just seems to ignore it.

--

So, here is my question: Am I the only one to notice that? Am I doing something wrong?

If not, is there any way to change that behaviour in Ubuntu? Any workaround?

Thanks in advance for your time

+3  A: 

Yes, Ubuntu 9.10 replaced upstream's notification-daemon with their own notify-osd, and generally made a mess of things.

You can ensure notification-daemon is installed (via whatever your favorite package manager front-end is) and use it in favor of notify-osd:

$ sudo mv /usr/share/dbus-1/services/org.freedesktop.Notifications.service /usr/share/dbus-1/services/org.freedesktop.Notifications.service.disabled
$ sudo mv /usr/share/dbus-1/services/org.freedesktop.Notifications.service.notify-osd /usr/share/dbus-1/services/org.freedesktop.Notifications.service

Unfortunately this will get overwritten whenever the package is updated... it's already using a dpkg-diversion so it's hard to re-divert it permanently.

ephemient
The only problem with this is that when I distribute the app I won't be able to control the environment. Thank you for your answer, though. You pointed in a good direction.
Flávio Amieiro
The solution given actually disables the libnotify notification which is not what i want. Is there any way I can solve that bug?
shadyabhi
@shadyabhi This solution, ideally, replaces Ubuntu's home-developed notifier with the older, upstream notifier, but it's somewhat of a hack. The best solution I've found: stop using Ubuntu, and switch to a distro that doesn't f*** around patching upstream packages with UI experiments.
ephemient
@ephemient Whats your favourite distro?
shadyabhi