Occasionally Spotify will break media control (play/pause, next, previous) buttons with every other update.
In order to overcome this, we can set some custom media key shortcuts.
We will set the shortcuts to use Right Ctrl + {media_key}
so as to not break regular media key function with other working apps.
For example I use the following:
Play/Pause : Right Ctrl + Play/Pause
Next : Right Ctrl + Next
Previous : Right Ctrl + Previous
Firstly confirm the following command plays / pauses media in Spotify.
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
If your Spotify media plays (and pauses with a second attempt), then simply create some custom keyboard shortcuts to bind the following commands:
Play / Pause
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
Next
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
Previous
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous