Right now, go-librespot reads configuration and credentials from the current working directory (unless specified otherwise). I propose we use the following scheme instead:
- Configuration is read from ~/.config/go-librespot/config.yml. The file is the same as it currently is.
- Credentials are stored in a new state file, in ~/.config/go-librespot/state.json. The file looks like this:
{
"credentials": {
"username": "...",
"data": "..."
},
"device_id": "..."
}
- The config directory is configurable with a flag, defaulting to
UserConfigDir() + "/go-librespot" so it also uses the appropriate directory on other OSes.
There are a few reasons why I think this is a good idea:
- I think the current directory is a bad place to store configuration. Maybe it's fine on a headless system, but at least the way I use go-librespot is on a regular user account (with config directory available).
- More state needs to be saved, such as ZeroConfig credentials. I also have an issue that Spotify keeps defaulting to "Let others Jam on this speaker" which I suspect is because the device ID is regenerated each time.
@devgianlu if you agree with this scheme I'd like to implement this (but asking here first before I put a lot of work into it).
Right now, go-librespot reads configuration and credentials from the current working directory (unless specified otherwise). I propose we use the following scheme instead:
{ "credentials": { "username": "...", "data": "..." }, "device_id": "..." }UserConfigDir() + "/go-librespot"so it also uses the appropriate directory on other OSes.There are a few reasons why I think this is a good idea:
@devgianlu if you agree with this scheme I'd like to implement this (but asking here first before I put a lot of work into it).