我可以禁用来自网络管理器的所有 libnotify 相关通知吗?“编辑连接”对话框没有帮助
是否存在像 OSX 设备那样的“请勿打扰模式”,您可以决定何时通知会打扰您,或不打扰您。
我刚刚安装了 chrome,我通常会收到群文本和其他通知的垃圾邮件,这在我尝试工作时会很烦人。 Ubuntu 是否存在类似的东西?
我正在尝试通过 espeak 过滤每个通知。但是,我似乎找不到从 python 脚本中获取通知正文的方法,甚至找不到要收听的信号名称。
bus.add_signal_receiver(espeak,
dbus_interface="org.freedesktop.Notifications",
signal_name="??")
Run Code Online (Sandbox Code Playgroud)
尝试为此使用谷歌似乎只会产生涉及创建新通知的结果,所以我现在完全迷失了。
任何人都可以帮助我吗?
简而言之,我想要的是使用python监听传入的通知,并获取通知的“body”属性。
书签:
可以通过 DBus 触发和调用 org.freedesktop.Notifications.CloseNotification(uint id) 吗?
目前,这个脚本
dbus-monitor "interface='org.freedesktop.Notifications'" | \
grep --line-buffered "member=Notify" | \
sed -u -e 's/.*/killall notify-osd/g' | \
bash
Run Code Online (Sandbox Code Playgroud)
将杀死所有待处理的通知。
最好使用 org.freedesktop.Notifications.CloseNotification(uint id)
. 是否有接口方法可以将它放在(在?)DBus 上以在发生特定通知事件时触发?
该方法需要获取通知 PID 以用作 的参数CloseNotification(uint id)
。或者,
qdbus org.freedesktop.Notifications \
/org/freedesktop/Notifications \
org.freedesktop.Notifications.CloseNotification(uint id)
Run Code Online (Sandbox Code Playgroud)
如果(uint id)
可以确定参数,则可以从外壳使用。实际的命令语法将使用整数代替(uint id)
。
也许首先要问的更好的问题可能是“如何找到通知的 DBus 地址?”。
这些都不能正确识别它:
gdbus monitor --session --dest org.freedesktop.Notifications
Run Code Online (Sandbox Code Playgroud)
返回
The name org.freedesktop.Notifications is owned by :1.130
...
Run Code Online (Sandbox Code Playgroud)
或者
dbus-monitor "interface='org.freedesktop.Notifications'"
Run Code Online (Sandbox Code Playgroud)
返回
... string …
Run Code Online (Sandbox Code Playgroud) Gnome3 是否有根据通知内容过滤桌面通知的方法?如果是这样,如何?
桌面通知很有用,我知道可以按应用程序关闭它们。
我希望能够做的是根据通知文本(或其他通知元数据,类似于 rsyslog question)过滤通知。我有一个应用程序通常会发送有用的通知,并且(在特定环境中)每几分钟发送一次我不想看到的通知。
通知是一个无害的警告但很烦人,因此如果桌面环境支持,过滤通知将是一个合理的解决方案。
类似要求:
notification ×5
notify-osd ×3
dbus ×1
gnome ×1
indicator ×1
libnotify ×1
notify-send ×1
python ×1
scripts ×1