24 April 2010

Spotify links in Ubuntu & Chrome


Spotify doesn't work in Linux, natively. (edit: it does now) So it's done using wine following this excellent howto.

This means however, that Chrome (and your Ubuntu) is unaware of spotify running "under the radar" as a wine/spotify.exe process. So when clicking a link, like this one: http://open.spotify.com/track/61K2lUXbNSvhEIOkhcozK4 spotify doesn't react.

I've Copy&Paste this dead-on recipe from another blog I found, just so I don't loose it in the future. I can confirm it's working on my Ubuntu 10.04 x64 desktop machine.



echo '#!/bin/sh' > ~/.browser2spotify
echo 'wine "$HOME/.wine/drive_c/Program Files/Spotify/spotify.exe" /uri "$@"' >> ~/.browser2spotify
chmod 755 ~/.browser2spotify
gconftool-2 -t string -s /desktop/gnome/url-handlers/spotify/command "/home/${USER}/.browser2spotify %s"
gconftool-2 -s /desktop/gnome/url-handlers/spotify/needs_terminal false -t bool
gconftool-2 -s /desktop/gnome/url-handlers/spotify/enabled true -t bool

The clue with this is to make gnome pass URLs starting with spotify: to the script which passes the URL to spotify.exe

This will do the job until Spotify makes a proper native linux client. Id'e think that wouldn't be too hard as it's an Adobe Air application, which is flash, which is pretty platform independent and very capable of running properly on Linux.

/Finn

1 comment:

  1. Here you get a recipe for the native spotify client:
    http://www.edmondscommerce.co.uk/linux/spotify-links-working-in-linux/

    ReplyDelete