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

0

1 Answer 1

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
1
  • 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...) Oct 21, 2016 at 12:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .