So if you have used Spotify on Linux you will notice that there are often times where it will crash on start or act very broken after a launch and that seems to be primarily due to unwanted data being left in cache or config temps which seem to cause hangups.
Here is a special little bash script that makes Spotify work more smoothly and this especially makes the latest Beta with Spotify Apps work very nicely but can work in earlier versions as well:
# Purge Spotify's ever horrible cache and temp config then run spotify
rm -Rf $HOME/.config/spotify && rm -Rf $HOME/.cache/spotify && spotify
For those who want to run this script as an application shortcut so it does tidying and then launches Spotify then simply do this from terminal:
1. nano spotify.sh
2. paste above code
3. chmod +x spotify.sh
4. Now sudo nano /usr/share/applications/spotify.desktop and paste this in but make sure to edit the “Exec” path to match the location of the Spotify.sh location on your system:
Comment=Listen to music using Spotify
Now whenever you click the Spotify icon in the Unity launcher or whatever DE on Ubuntu you happen to be using it should execute the spotify.sh script which will tidy up and then run Spotify.
Hope this is useful for some!