你如何处理功能键盘和键:
XF86AudioPlay
XF86AudioPause
XF86AudioPrev
XF86AudioNext
真棒wm? 我使用rc.lua
中的音量按钮设置了提升/降低/静音的快捷键 awful.key({ }, "XF86AudioRaiseVolume", function ()
awful.util.spawn("amixer set Master 9%+", false) end),
awful.key({ }, "XF86AudioLowerVolume", function ()
awful.util.spawn("amixer set Master 9%-", false) end),
awful.key({ }, "XF86AudioMute", function ()
awful.util.spawn("amixer set Master toggle", false) end),
我不知道如何使用Next / Prev / Play按钮。你如何解决?我想将这些键用于banshee / spotify。
答案 0 :(得分:2)
好的,我使用dbus(https://wiki.archlinux.org/index.php/Spotify#D-Bus)
攻击了这个 awful.key({ }, "XF86AudioPlay", function () awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause", false) end),
awful.key({ }, "XF86AudioNext", function () awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next", false) end),
awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous", false) end),
awful.key({ }, "XF86AudioStop", function () awful.util.spawn("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop", false) end),
答案 1 :(得分:0)
我两个使用了dbus,我制作了一个sh脚本来使控件变得聪明
这是我的脚本,也许你可以使用它:mediakeys.sh