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

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

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

在arch这里一切都很好,但是当我在Ubuntu上测试时,这种行为非常奇怪。

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.

由于Ubuntu显示通知的方式(就像咆哮的撕裂一样),我不能点击它们,或者以任何方式与它们交互。

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.

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

--

- - -

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?

如果没有,有没有办法改变Ubuntu的这种行为呢?有解决方案吗?

Thanks in advance for your time

提前谢谢你的时间。

1 个解决方案

#1


3

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

是的,Ubuntu 9.10用他们自己的notify-osd代替了上游的notificationdaemon,并且通常把事情弄得一团糟。

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

您可以确保安装了notificationdaemon(通过您最喜欢的包管理器前端),并将其用于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.

不幸的是,当包被更新时,这将被覆盖……它已经在使用dpkg转换,因此很难永久地重新转换它。

更多相关文章

  1. 在Linux中的脚本中安装应用程序
  2. 如何发送一个字节(或字节)来测试在我的应用程序中监听的套接字?
  3. 〖Linux〗使用Qt5.2.0开发Android的NDK应用程序
  4. 如何测试已部署的Web应用程序
  5. window下使用vnc远程登录linux图形界面和运行应用程序 和odroid
  6. [求助][CAB][安装包][CF2.0][SQL][setup]1000分请教:如何将CF2.0
  7. Android 通知(Notification)的基本用法
  8. 为什么我们应该将XMPP而不是JSON用于简单(仅文本)消息传递应用程序
  9. Android - 在一个应用程序中启动另外一个已经安装的应用程序或系

随机推荐

  1. android中shape的使用(android:angle小解)
  2. [置顶] Android:图解Activity启动流程源码
  3. 使用Android(安卓)Studio在64位Ubuntu环
  4. Android系统信息和安全机制(学习笔记)
  5. Android 第七天(下午)
  6. Android Menu
  7. Android/java 多线程(六)-AsyncTask使用
  8. ios/android 程序员
  9. View基础知识总结
  10. android的init.rc文件的语法