Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to be able to play, pause, chose next track or previous track from command line, but unfortunately no one seems to know how to do this (I have goggled repeatedly). I need it to be a command so that I can use it with blue proximity, so pause when I walk away. Are there any commands for this?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

The Spotify client has supported the MPRIS2 DBUS specification for ~4 years. Simply put this means most media remote controls should be able to control it.

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

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

For more commands, see the MPRIS2 Player specifications.

share|improve this answer
    
Play is in the specs. It should work. –  Oli Jul 6 at 16:21
1  
@Tim: Play doesn't work for me, either. Latest Spotify release here. –  Glutanimate Jul 6 at 16:38
1  
I can't even get Spotify on this laptop. I would guess they've just been lazy (seriously, it would have taken them a minute to implement) and they've skipped separate Play and Pause commands. –  Oli Jul 6 at 16:44
2  
@Oli: Probably. But then again from what I understand the Linux client is only developed one dev in their free-time. It's not officially supported by Spotify. With that in mind I can live with little faults like this –  Glutanimate Jul 6 at 17:04
1  
Weird, the specs doesn't say "should", "must", etc. –  Braiam Jul 6 at 17:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.