6

I've added Spotify launcher to Gnome Shell Dash so it's now a favorite app.
How do I add next / prev / play-pause / stop commands to Spotify context menu ?


For those who still find this unclear, the goal here is to have something like this:

enter image description here

7

After spending some time looking around for the answer I finally managed to make it work.

Just edit your spotify.desktop file under /usr/share/applications

enter image description here

[Desktop Entry]
Name=Spotify
GenericName=Music Player
Comment=Spotify streaming music client
Icon=spotify-client
Exec=spotify %U
TryExec=spotify
Terminal=false
Type=Application
Categories=Audio;Music;Player;AudioVideo;
MimeType=x-scheme-handler/spotify;

Actions=PlayPause;Next;Previous;Stop

[Desktop Action PlayPause]
Name=Play-Pause
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

[Desktop Action Next]
Name=Next
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next

[Desktop Action Previous]
Name=Previous
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous

[Desktop Action Stop]
Name=Stop
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
  • Keep in mind any update will overwrite the launcher in /usr/share/applications; ideally, you'd make a copy under ~/.local/share/applications/ - that way you have your own launcher that will remain unchanged (note that you'll have to either add #!/usr/bin/env xdg-open at the top and make it executable or double-click it and chose "mark as trusted" when prompted...) – don_crissti Oct 21 '16 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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