小编geo*_*ell的帖子

为 unity-panel-service 指标和 notify-OSD 定义的股票图标名称在哪里?

通知中的布局案例| Ubuntu App Developer 文档指出

...使用不存在的(股票)图标名称...使用新的图标名称之一(请参阅图标)...

并且这(http://wiki.ubuntu.com/mhall119/devportal/notify-osd#icons 上的图标)只是通过示例随意参考

... -i notification-message-im
... -i notification-network-wireless-disconnected
Run Code Online (Sandbox Code Playgroud)

想必

... -i notification-network-wireless-connected
Run Code Online (Sandbox Code Playgroud)

也是一个?
确认通过:(有趣的图标)

notify-send "WiFi icon test" -i notification-network-wireless-connected
Run Code Online (Sandbox Code Playgroud)

还有哪些呢?

(请注意,icons源中的链接:
wiki.ubuntu.com/mhall119/devportal/notidy-osd#icons
错误地将noti f y拼写为noti d y)


由于此答案的含义:

为 unity-panel-service 指标和 notify-OSD 定义的股票图标名称在哪里?

在上面的例子中的图标然后可以在这里找到:
- file:///usr/share/notify-osd/icons/gnome/scalable/status/
-file:///usr/share/notify-osd/icons/hicolor/scalable/status/

但是,虽然没有名为notification-network-wireless-connected该字符串的图标文件显示notification-network-wireles.svgnotification-network-wireless-gobledeegook!

书签:
为 unity-panel-service 指标和 notify-OSD 定义的股票图标名称在哪里?

indicator icons notify-osd

52
推荐指数
2
解决办法
3万
查看次数

可以通过 DBus 触发和调用 org.freedesktop.Notifications.CloseNotification(uint id) 吗?

参考:
notify-osd 上的关闭按钮?

书签:
可以通过 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)

notification dbus

6
推荐指数
2
解决办法
2048
查看次数

标签 统计

dbus ×1

icons ×1

indicator ×1

notification ×1

notify-osd ×1