1.) Native Spotify player for Linux (requires Unlimited or Premium)
Create spotify-control containing this (credits go to this allenap):
#!/usr/bin/env python
import dbus
import sys
if __name__ == '__main__':
session = dbus.SessionBus.get_session()
spotify = session.get_object(
"org.mpris.MediaPlayer2.spotify",
"/org/mpris/MediaPlayer2")
for command in sys.argv[1:]:
getattr(spotify, command)()su
chmod 755 spotify-control
Next, put the file into i.e. /usr/bin/
Now you got a cmd way of controling your spotify player.. spotify-control Previous, spotify-control Next and spotify-control PlayPause...
If you are using fluxbox as I am, add the following to your ~/.fluxbox/keys
# Spotify
Mod4 Right :Exec $(spotify-control Next)
Mod4 Left :Exec $(spotify-control Previous)
Mod4 space :Exec $(spotify-control PlayPause)
Save, "reconfigure" (or restart fluxbox), and you are done..
Now you can use your windows button + Right/Left for Next/Previous or Space to pause :)
2.) If you are using spotify via wine..
This way is a bit more "unslick" and nasty.. But it works..
You do it the same way, except you use the following script located here..