Probably half the entries in that list are not GUI apps, and XDG doesn't apply (though some still support it). For some others there (like emacs) XDG is used if it exists.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
XDG doesn't apply for CLI apps? About half of dirs I still have cluttering my home are GUI apps whose devs refuse to follow the specification, while I see less friction from CLI/TUI devs, since they're the ones actually seeing these hidden locations.
vim now has an option to put the .vim folder in ~/.config; though I'm not sure if the default plugin/package & syntax folders can be set under ~/.local/share.
100% agree and I also despise devs who do this on windows, instead of using %appdata% they’re using c:\users\username\.myappisimportantandtotallydeservesthisdir
I have to use a separate Documents folder for my actual documents lol
To be fair here, appdata is technically a hidden folder and there are lots of reasons an app would want it's data accessable by the user.
Yes but then just spam the documents folder like anyone else, don’t hoard the home root for no reason except that is a lazy cross platform port
Where did i read this... basically, the .file being hidden being a bug in the early unix filesystem, which got misused to hide configuration files.
Offenders despite XDG-variables set and with no workaround:
- .android: hardcoded in adb and i guess something in mtp too
- .pki: some tool/library Firefox and Chromium sometimes use.
- .steam: yes, that
Shout out to xdg-ninja - it'll find files that are in your home and suggest how to configure the app to use XDG instead. https://github.com/b3nj5m1n/xdg-ninja
Are there abstractions available around the XDG specifications to resolve the proper paths?
What language? Python has PyXDG.
In shell it's simply
XDG_DATA_HOME="${XDG_DATA_HOME:-"$HOME"/.local/share}"
XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-"$HOME"/.config}"
etc.
Thanks, I did not know about PyXDG. That was the type of thing I was asking about.
Use the environment variables.
I do. But you might have misunderstood my question. I was not asking for assistance. I was just curious if there are libraries available which allow easy adoption of the XDG specification. I imagine that such abstractions would be useful for multi-platform software and generally to lower the bar for adoption.
Depends on the programming language. In C# for example, there's an API to get special folder paths that works in all supported environments (Windows, Linux, MacOS, Android, and I think iOS too). On Linux, it includes fallbacks in case the environment variables aren't set.
حق
there's no place like 127.0.0.1
there's no place like XDG_CONFIG_HOME.