Remix.run Logo
PunchyHamster 2 hours ago

Well, they are supposed to be all in .config, problem is many app developers think they are special little boys that deserve its own directory

delta_p_delta_x 2 hours ago | parent | next [-]

%LOCALAPPDATA% on Windows. Or better still, use GetAppContainerFolderPath or SHGetKnownFolderPath with FOLDERID_LocalAppData.

ziml77 an hour ago | parent [-]

I don't know if anyone is actually using roaming profiles, but config should go into the %APPDATA% folder to support that. %LOCALAPPDATA% is for things that shouldn't be synced to different machines, such as caches.

Uvix 24 minutes ago | parent [-]

I know we used to use them in our corporate environment. Not sure if we still do, or if they gave up and called OneDrive “good enough”.

delusional an hour ago | parent | prev [-]

It all sounds so easy, until you learn about the XDG Base Directory Specification[1]. You're actually supposed to do a whole song and dance around a hierarchical set of environment variables, associated defaults, and resolution orders.

Interfacing with people is never easy.

[1]: https://specifications.freedesktop.org/basedir/latest/

archargelod 16 minutes ago | parent [-]

No. Actually, it's easy. Just check for directory or use a fallback. For example here's how you'd do this in bash:

    export CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
    export CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}"
    ...
XDG_*_DIRS are a bit more complicated, but nothing that can't be solved with a simple for-loop in any modern programming language.