Closed jleclanche closed 7 years ago
Since we already have many users with their configuration at $HOME/.sqlectron.json
. I believe it should follow this approach:
$HOME/.sqlectron.json
1.1. Yes - Load config from there.
1.2. No - Check if there is $XDG_CONFIG_HOME/sqlectron/config.json
1.2.1. Yes - Load config from there.
1.2.2. No - Create a config there and load config from there.For what it's worth it looks like Electron does use xdg by default:
[23:52:43] adys@azura ~ % tree .config/Sqlectron
.config/Sqlectron
├── GPUCache
│ ├── data_0
│ ├── data_1
│ ├── data_2
│ ├── data_3
│ └── index
├── Local Storage
└── Preferences
2 directories, 6 files
[23:52:48] adys@azura ~ % cat .config/Sqlectron/Preferences
{"brightray":{"media":{"device_id_salt":"2Hlo3B4A93z19AYKToAdzg=="}}}
I'm guessing there's probably an API you can use ...
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
TLDR: Configuration should be in the
$XDG_CONFIG_HOME/sqlectron/
directory instead of in the homedir. If not defined,$XDG_CONFIG_HOME
should be defaulted to$HOME/.config
.This is pretty standard and helps keep clutter out of the homedir :)