Support for Spotify URLs in Linux

Spotify makes it easy to share playlists between users. And websites like help you find playlists from people you don’t know.

By default, the Linux version of Spotify doesn’t add the necessary url-handlers to let you simply click on Spotify URLs on the internet and launch them automatically.

Modern distributions will send urls to xdg-open which on a GNOME desktop, in turn, uses gnome-open to try and launch the correct default application.

Typing the following lines in a terminal will make sure you’re good to go.

gconftool-2 -t string -s /desktop/gnome/url-handlers/spotify/command 'spotify -uri "%s"'
gconftool-2 -s /desktop/gnome/url-handlers/spotify/enabled true -t bool
gconftool-2 -s /desktop/gnome/url-handlers/spotify/needs_terminal false -t bool

You can confirm that these have been set correctly in gconf-editor.

And you can test the set up from the terminal like this:

gnome-open "spotify:user:sharpblue:playlist:33FQ0bK3GVtRC98WsB8hE4"

Good luck!

Alternative Solution

Found on here (from user fresta):

Create (as root) a file “/usr/share/applications/spotify-uri.desktop” (or as a user “~/.local/share/applications/spotify-uri.desktop”) with:

[Desktop Entry]
 Comment=Listen to music using Spotify
 Exec=spotify -uri %u

And then run:

sudo update-desktop-database

This has worked for people who had no luck with the gconf keys method, and should work on non-GNOME desktops too.

This entry was posted in gnome, linux, spotify. Bookmark the permalink.

Leave a Reply

Your email address will not be published.