When you open a Spotify URL in linux Google Chrome, this launches spotify web player instead of native application.
-
Install Switcheroo Redirector extension for Google Chrome and create next routes.
http://open.spotify.com/ -> spotify: http://play.spotify.com/ -> spotify: https://open.spotify.com/ -> spotify: https://play.spotify.com/ -> spotify:
-
Rename spotify application
sudo mv /usr/bin/spotify /usr/bin/spotify-base
-
Create a bash file with this code (i.e. ~/spotify-launcher.sh)
#!/bin/bash if [[ -z $1 ]]; then spotify-base & else # remove protocol uri=spotify${1#*spotify} # remove query string uri=${uri%\?*} # replace / with : uri=${uri//\//:} # launch spotify spotify-base /uri "${uri}" & fi
-
Create a symbolic link for new spotify laucher
sudo ln -s ~/spotify-launcher.sh /usr/bin/spotify