Ubuntu 9.10 中奇怪的 pynotify 行为

发布于 2024-08-18 20:21:43 字数 558 浏览 6 评论 0原文

我编写了一个 小应用程序,我正在使用 pynotify 向用户显示一些消息。

在 arch 中一切正常,但是当我在 Ubuntu 中测试它时,行为非常奇怪。

由于 Ubuntu 显示通知的方式(似乎是咆哮的声音),我无法点击它们,或以任何方式与它们交互。

然而,最大的问题是它一次只显示一个通知,并且必须等待(默认情况下很长一段时间)直到其中一个通知消失才能显示下一个通知。

考虑到我正在编写的小应用程序的性质(一个简单的监视器,每次更改文件时都会运行命令),结果必须实时显示给用户。

我尝试使用 message.set_timeout() 设置一个小的超时,但 Ubuntu 似乎忽略了它。

——

所以,我的问题是:我是唯一注意到这一点的人吗?我做错了什么吗?

如果没有,有什么办法可以改变 Ubuntu 中的这种行为吗?有什么解决办法吗?

预先感谢您的宝贵时间

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏有森光若流苏 2024-08-25 20:21:43

是的,Ubuntu 9.10 用自己的 notify-osd,通常会把事情搞得一团糟。

您可以确保安装了 notification-daemon(通过您最喜欢的包管理器前端)并使用它来支持 notification-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

不幸的是,每当包更新时,这都会被覆盖......它已经在使用 dpkg-diversion因此很难永久地重新转移它。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文