2

So under my volume drop down menu, I have Spotify, Rhythmbox and VLC:

enter image description here

Here I can pause and play the various different applications. My question is, is there a command to pause the one that is currently playing, e.g. I could set up a short cut to pause whichever was playing. This is mainly because Spotify doesn't have command options as far as I can tell, and I would like to pause it using blue proximity when I get up?

Tim
  • 33,500

1 Answers1

2

If you need command-line access, you can talk to it directly over DBUS. Here's an example I stole from Fran DiƩguez:

To pause:

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

Or to toggle:

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

For more commands, see the MPRIS2 Player specifications.

Taken from Oli's answer to this question.

Tim
  • 33,500