How to control Spotify music from the launcher in Ubuntu

spotify-launcher

The latest version of Spotify for Linux has included interesting news but, as is more common than we would like, when some bugs are added or corrected, others may appear. This is what has happened in the recent update, where Spotify has seen its icon in the tray has disappeared, making it impossible to control music playback without opening the application window. But, as everything in Linux has a solution, today we bring you a way to control Spotify music playback from the launcher.

Keep in mind that what is described in this tutorial only necessary for version 1.0.23.93 from Spotify. The previous version did offer the option to minimize the application in the top bar, so adding the possibility in the launcher could also be somewhat redundant. In any case, if you prefer to control from the launcher, it can also be tested in previous versions. Here are the steps to follow to do it.

How to control Spotify from the launcher

Getting to control Spotify for Linux from the Ubuntu launcher is a very simple process. The only thing is that it is worth writing it down somewhere because we will have to edit a Spotify file and most likely, when updated, return to original state. We will achieve this by performing the following steps:

  1. We have to edit the file spotify.desktop which is in the path / usr / share / applications. We can open and edit it by opening a Terminal and typing the following command:
sudo gedit /usr/share/applications/spotify.desktop
  1. In the file that opens, we select all the text (Ctrl + A) and delete it.
  2. Next, we copy the following and paste it into the file:
[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=PlayOrPause;Stop;Next;Previous

[Desktop Action PlayOrPause]
Name=Reproducir/Pausar
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
OnlyShowIn=Unity;

[Desktop Action Stop]
Name=Parar
Exec=dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
OnlyShowIn=Unity;

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

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

gedit-spotify

  1. Then we click on Save.
  2. Now we restart Spotify.
  3. Once the process is done, to control Spotify from the launcher we just have to right click on its icon and choose Play / Pause, Stop, Next or Previous.
  • Note: if you want to change the displayed text, you can do so by changing the lines where it says "Name =", where you can change, for example, Play / Pause to "Give it a shot!" I comment on it because it is a possibility that exists and I know that there are many people with humor who might be interested in personalizing this point.

It is worth doing all the steps and controlling Spotify from the sidebar, right?


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Miguel Angel Santamaría Rogado said

    Hello,

    removing the notification icon is not a bug, many users wanted (we wanted) to remove it or at least be able to choose whether it was displayed or not. Spotify integrates natively with the sound menu allowing you to control playback without accessing the program window, so the icon did not contribute anything and simply took up space.

    Greetings.

    1.    Miguel Angel Santamaría Rogado said

      Well, I just updated and the integration with the sound menu has been loaded and the application menu does not appear; seems like a problem with dbus. They also consider that removing the notification icon is a bug, although they specify that they have no intention of solving it. They have excelled with the update, almost better to go back to the previous version (spotify-client-0.9.17 package).

      For more information: https://community.spotify.com/t5/Help-Desktop-Linux-Windows-Web/Linux-Spotify-client-1-x-now-in-stable/td-p/1300404

      Greetings.

  2.   pepper said

    If Spotify has no intention of fixing the bug, then it is not worth it as a service, and pay less money and better look for alternatives

  3.   Gabriel said

    Well, I just updated to version 1.0.24.104.g92a22684 and the same problems are still present.

    As additions to the solution of this post, comment a couple of things:

    - If the line "OnlyShowIn = Unity;" Actions will appear in any desktop environment that supports them, not just Unity.

    - If instead of modifying the system launcher (/usr/share/applications/spotify.desktop) a new one is created in ~ / .local / share / applications with the same name (spotify.desktop) the modifications will not be lost when Spotify is updated

    1.    Gabriel said

      Version 1.0.28.89.gf959d4ce has been released and MPRIS integration is working properly again; so it is once again possible to control playback using the sound indicator.

      Greetings.