Tuesday, April 23, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 8366  / 1 Year ago, fri, april 7, 2023, 2:45:36

I'm running the Spotify Linux Beta. My keyboard is a Logitech Illuminated something wired keyboard.



My keyboard hotkeys work with Banshee, but not with Spotify, even though controlling Spotify via the "Volume" widget in the top right of the upper panel works fine.


More From » 11.04

 Answers
4

I did the following using this guide: http://www.mabishu.com/blog/2010/11/15/playing-with-d-bus-interface-of-spotify-for-linux/



You will need to install mdbus2:



sudo apt-get install mdbus2


Now you can try out to play/pause:



dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause


To bind this to a key you need for example AutoKey.



sudo apt-get install autokey-gtk


Create a new script and use this code:



system.exec_command("dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause", getOutput=False)


and bind it to whatever key you want to use.



Of course you can use the same method to create hotkeys for next and previous :)



This command will show you which methods that is available:



mdbus2 org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2


Though, I don't know what will happen if you use both banshee and spotify with the same hotkey!


[#43144] Saturday, April 8, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bsorbedeldy

Total Points: 315
Total Questions: 110
Total Answers: 108

Location: Reunion
Member since Mon, Dec 28, 2020
3 Years ago
;