Announcements

Help Wizard

Step 1

NEXT STEP

Is it possible to start Spotify with a different .config?

Solved!

Is it possible to start Spotify with a different .config?

I run native Linux client 64-bit. In the latest version I can't search for anything, because it crashes with 'segmentation fault' as soon as I type anything in the search field. Therefore I repackaged an older version, removed the files that conflicts with the newer version and renamed it spotify-legacy, so that I can have both installed. The older version can't play local files, therefore I can't have them shown in that version, because it stops when it come to a local file. So I want to have different .config for them, instead of change in preferences everytime I need to switch which version to use. There is nothing in preferences about using a different .config (only about cache).

 

Is it possible to start Spotify with a command that tells it to use a different config folder?

 

 

Reply

Accepted Solutions
Marked as solution

Cache is ~/.cache/spotify and config is ~/.config/spotify.

 

Inspired by how I start two instances of dropbox I just tried this:

HOME=$HOME/.config/spotify-legacy /usr/share/spotify/start-spotify

And it works!!! 😄 Now it puts both .cache and .config in ~/.config/spotify-legacy.

View solution in original post

6 Replies

Hi, if I am remembering correctly (I am probably wrong) the cache folder also contains the configuration data.

 

If it doesn't, then I'm afraid there is no way to do this.

 

Liam

Marked as solution

Cache is ~/.cache/spotify and config is ~/.config/spotify.

 

Inspired by how I start two instances of dropbox I just tried this:

HOME=$HOME/.config/spotify-legacy /usr/share/spotify/start-spotify

And it works!!! 😄 Now it puts both .cache and .config in ~/.config/spotify-legacy.


@lenanel wrote:

Cache is ~/.cache/spotify and config is ~/.config/spotify.

 

Inspired by how I start two instances of dropbox I just tried this:

HOME=$HOME/.config/spotify-legacy /usr/share/spotify/start-spotify

And it works!!! 😄 Now it puts both .cache and .config in ~/.config/spotify-legacy.


Thanks for sharing your solution!

Of course anything which works is fine. And perhaps the rather brutal solution to reset $HOME is the only way out of this.

 

However, the directories ~/.config and ~/.cache are not not random choices, they are part of the freedesktop specification. According to this it should be possible to change the config directory ~/.config using the XDG_CONFIG_HOME environment variable. Likewise, relocating ~/.cache should be possible using XDG_CACHE_HOME.

 

If this doesn't work it s plain bug IMHO, since the usage of ~/.cache and ~/.config is so clearly defined in the spec

I tried this:

XDG_CONFIG_HOME=$HOME/.config/spotify-legacy /usr/share/spotify/start-spotify

 

Before that I renamed ~/.config/spotify-legacy and added .old. It created a new folder ~/.config/spotify-legacy and put a file  Trolltech.conf there, but no folder for .config. It used the same settings as I have in ~/.config/spotify. So I guess this means "it doesn't work"...

 

I tried to echo some of the variables from your link, but none of them were set. I'm running Linux From Scratch, so it could of course be a problem with my system...

They are normally not set, that's as expected. Reading the spec, this means that we use ~/.config and ~/.cache in that case.

 

More worrying is that a simple 'strings' on the spotify binary shows no sign of any XDG_* string. libcef.so has XDG_CACHE_HOME  (and XDG_DATA_HOME, not used by spotify) but not XDG_CONFIG_HOME. So it seems likely that spotify does not respect XDG_CACHE_HOME and XDG_CONFIG_HOME.

 

Which, in that case, is a bug. If there was a bugtracker, it should have been reported there. But there isn't 🙂  Anyway, something to be fixed to next release. Until then, relocating $HOME seems to be the only way unless the devs comes up with more info.

 

EDIT: changing $HOME is actually not without risks e. g., if spotify spawns  new process. Generally, $HOME is expected to be, well , $HOME 🙂 A safer bet would be to create one or two shell wrappers which symlinked the alternative config/cache directories to ~/.config/spotify and  /.cache/spotify. Just my 5 öre...

 

EDIT2: I've got a confirmation that spotify does not respect XDG_CACHE_HOME and XDG_CONFIG_HOME. from the devs.  It's a bug, probably fixed in next release.

Suggested posts