Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use XDG basedir spec on linux #327

Closed
jleclanche opened this issue Jun 18, 2017 · 3 comments
Closed

Use XDG basedir spec on linux #327

jleclanche opened this issue Jun 18, 2017 · 3 comments

Comments

@jleclanche
Copy link

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 :)

@maxcnunes
Copy link
Member

Since we already have many users with their configuration at $HOME/.sqlectron.json. I believe it should follow this approach:

  1. Check if there is $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.

@jleclanche
Copy link
Author

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 ...

@jleclanche
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants