2

After discovering my installed version (1.0.77.338.g758ebd78) crashes immediately when I open a podcast, installed from spotify's repository, I removed it from my repositories using sudo software-properties-gtk and installed it with Snap instead.
Now, it no longer appears in apt list --installed but it's there in snap list and it's now the latest version (1.0.80.474.gef6b503e) and podcasts work wonderfully.
However, I had media shortcuts in place to play/pause, skip to next track and return to previous track and I even had it as the default music player which I did by assigning %U to its .desktop file.
The media keys no longer work and for the life of me I can't find the .desktop file anywhere.
I'm using Ubuntu 18.04.
Any help would be greatly appreciated.
*EDIT: Now, the media controls are working. I didn't do anything special, but I remember using sudo snap refresh and using sudo apt dist-upgrade so that may be it. However, I still need help making spotify the default music player again.

Oussema
  • 144
  • 1
  • 3
  • 18
  • " I even had it as the default music player which I did by **assigning %U to its .desktop file**. The media keys no longer work and for the life of me **I can't find the .desktop file** anywhere." ... Unclear – cmak.fr Jun 05 '18 at 04:51
  • I followed [this answer.](https://askubuntu.com/a/96868/834361) I previously opened the Spotify.desktop file, looked for the `Exec= Spotify` line and made it into `Exec= Spotify %u`. But, after removing the version installed using the official repositories and installing it with snap, I don't know where the Spotify.desktop file is so I can't do the same. – Oussema Jun 05 '18 at 05:00
  • try this : `sudo updatedb; locate *.desktop | grep -i spotify` – cmak.fr Jun 05 '18 at 13:13
  • No output from the command you gave – Oussema Jun 05 '18 at 23:06

1 Answers1

2

the desktop file should stand in this folder

/var/lib/snapd/desktop/applications

You can create a new one if needed

sudo tee -a /var/lib/snapd/desktop/applications/spotify.desktop << ENDsd
[Desktop Entry]
Type=Application
Name=Spotify
GenericName=Music Player
Icon=/usr/share/spotify/icons/spotify-linux-128.png
TryExec=spotify
Exec=spotify %U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify
ENDsd

Or copy/paste those lines in /var/lib/snapd/desktop/applications/spotify.desktop

[Desktop Entry]
Type=Application
Name=Spotify
GenericName=Music Player
Icon=/usr/share/spotify/icons/spotify-linux-128.png
TryExec=spotify
Exec=spotify %U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify
cmak.fr
  • 8,411
  • 2
  • 29
  • 45
  • 1
    Thank you! Found out it was named spotify_spotify.desktop for some reason and it had a longer value of Exec. Now after making a new file and a quick log out, the media controls are working and it is the default audio player. – Oussema Jun 06 '18 at 13:34