键盘弹奏/停止/下一个/上一个按钮不适用于Spotify
我正在运行Spotify Linux Beta。 我的键盘是Logitech Illuminated东西有线键盘。
我的键盘热键与Banshee配合使用,但与Spotify不兼容,即使通过上面板右上角的“音量”小部件控制Spotify也能正常工作。
我使用本指南执行了以下操作: http : //www.mabishu.com/blog/2010/11/15/playing-with-d-bus-interface-of-spotify-for-linux/
您需要安装mdbus2:
sudo apt-get install mdbus2
现在你可以尝试播放/暂停:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
要将其绑定到您需要的键,例如AutoKey。
sudo apt-get install autokey-gtk
创建一个新脚本并使用以下代码:
system.exec_command("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause", getOutput=False)
并将其绑定到您要使用的任何键。
当然你可以使用相同的方法为下一个和前一个创建热键:)
此命令将显示可用的方法:
mdbus2 org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2
虽然,我不知道如果你同时使用banshee和spotify使用相同的热键将会发生什么!
免责声明 :我为Spotify工作
这是Linux客户端已知的缺失function,但我们在0.9.4版本中添加了它。 因此,虽然这个线程相当陈旧,但值得注意的是它现在应该可行。 如果您仍然遇到媒体密钥问题,请在社区论坛上发布消息。
与Spotify有同样的问题。 在完成上述所有操作后,我检查了键盘绑定,并注意到我让热键解除绑定。
在终端unity-control-center keyboard
或在设置中转到键盘,转到Shortcuts
选项卡,然后转到Sound and Media
。 确保您有媒体密钥的绑定。