dad*_*x86 6 notification sound unity pulseaudio bluetooth
可能这个问题已经在某处得到了回答,但我找不到它。
情况:我在笔记本电脑上使用 Ubuntu 15.10。
我有一个辅助蓝牙扬声器系统,在该系统上我重定向了一些输出(主要是音乐)。
我可以控制与卷pactl带
pactl -- set-sink-volume bluez_sink.00_18_91_65_D8_6D +5%
pactl -- set-sink-volume bluez_sink.00_18_91_65_D8_6D -5%
Run Code Online (Sandbox Code Playgroud)
并将其与某些键盘快捷键相关联,我可以增加和减少它,就像它是本地的一样。
这工作正常,但与主输出(内部声卡)不同,使用此命令不会产生具有实际音量级别的通知。
那么,如何像 Ubuntu 一样使用不断变化的图标和音量栏来生成通知?
我应该使用notify-send吗?用哪些参数?
它不应该是一个“正常”的通知,因为当音量改变时它必须“粘”在那里并且只是调整条形......
是的,应该是特别通知:
gdbus call --session --dest org.freedesktop.Notifications \
--object-path /org/freedesktop/Notifications \
--method org.freedesktop.Notifications.Notify \
'gnome-settings-daemon' \
0 \
'notification-audio-volume-medium' \
' ' \
'' \
[] \
"{'x-canonical-private-synchronous': <'volume'>, 'value': <24>}" \
1
Run Code Online (Sandbox Code Playgroud)
通过观察发现dbus-monitor:
method call time=1447796042.858910 sender=:1.11 -> destination=:1.96 serial=216 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
string "gnome-settings-daemon"
uint32 0
string "notification-audio-volume-medium"
string " "
string ""
array [
]
array [
dict entry(
string "x-canonical-private-synchronous"
variant string "volume"
)
dict entry(
string "value"
variant int32 48
)
]
int32 -1
Run Code Online (Sandbox Code Playgroud)然后使用以下方法编写我自己的电话:
gdbus跟随这篇文章如何将{sv}参数传递给gdbus?可用的图标有:
find /usr/share/notify-osd/icons/hicolor/scalable/status/ -name "notification-audio-volume-*" -exec basename {} .svg \;
notification-audio-volume-low
notification-audio-volume-off
notification-audio-volume-medium
notification-audio-volume-muted
notification-audio-volume-high
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
1310 次 |
| 最近记录: |