Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Hello everyone,
I would like to be able to control some basic functions via command line like play/pause, could someone help?
Thanks!
Solved! Go to Solution.
Or you could just use dbus-send directly:
Play:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play
Pause:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
Play/Pause toggle:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
Previous:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
Next:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
Volume and seeking doesn't work via MPRIS because their MPRIS implementation is broken.
Or you could just use dbus-send directly:
Play:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play
Pause:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
Play/Pause toggle:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
Previous:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
Next:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
Volume and seeking doesn't work via MPRIS because their MPRIS implementation is broken.
It doesn't work for me, when i type these commands, dbus sends this error:
Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.mpris.MediaPlayer2.spotify was not provided by any .service files
Do you know how can i fix it?
On a standard install it should work, I have not tested them with the snap or flatpak. I know that the flatpak versions has issues. For example you can't raise it via dbus or MPRIS last time I checked. Spotify has to be running of course for any of the commands to work also.
I really wish they would open up their API. I don't see the logic of keeping the API closed and then releasing a garbage desktop app? Don't get me wrong, I love the spotify service (So much I actaully pay for it,lol!!!) But let's face it the desktop app is **bleep**... If they opened up the API it would take about a week and you'd have at least a couple awesome native Linux Spotify apps that they would not have to worry about.
Thanks this would be I guess a good complete solution! I was searching for a really basic and simple solution so I marked the dbus reply as solution but thanks for this hint as well!
Best
Eds
Hey there you, Yeah, you! 😁 Welcome - we're glad you joined the Spotify Community! While you here, let's have a fun game and get…