16

"Spotify for linux" doesn't show up in default applications menu for Music (system info section in system settings).

Therefore, it also doesn't come in Dash and music media keys don't work as well.

How to make it the default application for playing Music or make media keys work?

5 Answers 5

10

Don't have spotify so can only answer question 1 generally

The 'Default music player', or 'Listen to Music' in the Dash is set by whatever app is the default application for audio/x-vorbis+ogg

That is the extent of the usefulness to setting a default music player in System Settings > System Info > Default Applications > Music

To use a player that doesn't show up in the above setting's dropdown list there are 2 ways, most direct, in all cases the app must have a .desktop, in this case maybe spotify.desktop

gedit ~/.local/share/applications/mimeapps.list

In the [Default Applications] section look for this line

 audio/x-vorbis+ogg=

If it's there replace the whatever.desktop with the whatever.desktop of your choice, otherwise just add the line, Example - I've set audacious, you'd be using spotify.desktop if it exists

[Default Applications]
audio/x-vorbis+ogg=audacious2.desktop

Additionally you may want to add that whatever.desktop to the end of the same line in [Added Associations], same example, note that entries in Added end with ;

[Added Associations]
audio/x-vorbis+ogg=vlc.desktop;audacious2.desktop;

The other thing that can be done is to open your app's .desktop file in a text editor, in this case possibly spotify.desktop

Add a %U to the end of the Exec= line, again using as an Example audacious

Exec=audacious2 %U

Also look for a MimeTypes= line & see if there is this entry, audio/x-vorbis+ogg;

If not then just add to end of line

1
  • It took a couple of minutes for Spotify to appear in "default apps", but worked perfectly. Apr 9, 2019 at 14:53
4

As doug suggested, simply add this line to your ~/.local/share/applications/mimeapps.list file in two places, like so:

[Default Applications]
...
audio/x-vorbis+ogg=spotify.desktop

[Added Associations]
...
audio/x-vorbis+ogg=spotify.desktop;

After doing this, Spotify instantly showed up as my default music played in Unity.

Cheers!

1
  • Any idea how to make to open the already running Spotify instance instead of launching a new one?
    – Piranna
    Sep 25, 2017 at 10:33
1

In trying to make this work in Ubuntu 21.04 (yes hirsute hippo) I notice there is a mimeapps.list in ~/.config but none in ~/.local/share/applications.

I made the change there (in my case I wanted to make Cantata the default) as per the instructions given and it worked just fine.

0

In 18.04 I added those lines to /usr/share/applications/mimeapps.list [New File]

[Default Applications]
audio/x-vorbis+ogg=spotify.desktop
[Added Associations]
audio/x-vorbis+ogg=spotify.desktop;

Works like a charm! Now I can finally skip using keyboard shortcuts.

0

Doug's answer works well. I wanted to add that the .desktop file for spotify is now spotify_spotify.desktop and my ~/.local/share/applications/mimeapps.list file looks like this:

[Default Applications]
audio/x-vorbis+ogg=spotify_spotify.desktop
[Added Associations]
audio/x-vorbis+ogg=spotify_spotify.desktop;

You must log in to answer this question.

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