this post was submitted on 14 Jul 2024
284 points (94.7% liked)

Linux

48044 readers
777 users here now

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

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Shameless plug: I am the author.

(page 2) 50 comments
sorted by: hot top controversial new old
[–] [email protected] 0 points 3 months ago (2 children)

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.

[–] [email protected] 6 points 3 months ago (2 children)

What makes you think XDG doesn't apply to non GUI apps?

load more comments (2 replies)
[–] [email protected] 8 points 3 months ago

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.

[–] [email protected] 5 points 3 months ago (1 children)

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.

load more comments (1 replies)
[–] [email protected] 38 points 3 months ago* (last edited 3 months ago) (4 children)

100% agree and I also despise devs who do this on windows, instead of using %appdata% they’re using c:\users\username\.myappisimportantandtotallydeservesthisdir

[–] [email protected] 10 points 3 months ago

I have to use a separate Documents folder for my actual documents lol

[–] [email protected] 1 points 3 months ago (1 children)

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.

[–] [email protected] 8 points 3 months ago

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

load more comments (2 replies)
[–] [email protected] 22 points 3 months ago* (last edited 3 months ago)

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

Btw, https://wiki.archlinux.org/title/XDG_Base_Directory

[–] [email protected] 70 points 3 months ago (4 children)

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

load more comments (4 replies)
[–] [email protected] 1 points 3 months ago (2 children)

Are there abstractions available around the XDG specifications to resolve the proper paths?

[–] [email protected] 7 points 3 months ago* (last edited 3 months ago) (1 children)

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.
[–] [email protected] 2 points 3 months ago

Thanks, I did not know about PyXDG. That was the type of thing I was asking about.

[–] [email protected] 5 points 3 months ago (1 children)

Use the environment variables.

[–] [email protected] 1 points 3 months ago (1 children)

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.

[–] [email protected] 2 points 3 months ago

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.

[–] [email protected] 1 points 3 months ago
[–] [email protected] 9 points 3 months ago

there's no place like 127.0.0.1

there's no place like XDG_CONFIG_HOME.

load more comments
view more: ‹ prev next ›