Shameless plug: I am the author.

-3 points

This would just further complicate things for me. It assumes that 1) the system even has a windowing system/desktop environment or 2) all the installed software is XDG-aware. Most of the time I’m fiddling with headless environments.

permalink
report
reply
25 points

It’s not too hard to check for XDG support first and use a few hardcoded directory paths if that is unavailable.

permalink
report
parent
reply
-6 points

It’s even easier to ignore it altogether, which is what I do. I don’t use “a few” non-XDG-aware things; I use lots an lots of them.

permalink
report
parent
reply
25 points

Are you saying that you don’t want to write your software according to the XDG spec, or that you don’t want to set the XDG env vars on your system? If it’s the second that’s fine - apps using XDG work just fine if you ignore it. If it’s the first I’d suggest reconsidering because XDG can make things much easier for users of your software who have system setups or preferences that are different from yours; and using XDG doesn’t cause problems for users who ignore it.

OP’s recommendation is aimed mostly at software authors.

permalink
report
parent
reply
24 points

So yes, “XDG” stands for “Cross-Desktop Group” - but I don’t agree that using the spec assumes a windowing system. The base directory spec involves checking for certain environment variables for guidance on where to put files, and falling back to certain defaults if those variables are not set. It works fine on headless systems, and on systems that are not XDG-aware (I suppose that means systems that don’t set the relevant env vars).

OTOH as another commenter pointed out the base directory spec can make software work when it otherwise wouldn’t on a system that doesn’t have a typical home directory layout or permissions.

permalink
report
parent
reply
11 points

The spec doesn’t make those assumptions at all, idk where that’s coming from.

permalink
report
parent
reply
-11 points

Whatever happened to Linux being all about choice? Do you want that or not?

https://xkcd.com/927

permalink
report
reply
5 points

Choice, huh? I can’t choose where the config files are stored unless I am willing to either dig into an obscure setting, modify the source code and recompile (repeat every time there’s an update), or contact the developer’s smug beard using smoke signals.

permalink
report
parent
reply
-12 points

idk that all sounds like choices to me

permalink
report
parent
reply
14 points

Are there other relevant standards? The XDG base directory specification has been around for a long time, and is well established.

Maybe your comment wooshed over my head; if so I apologize.

permalink
report
parent
reply
-16 points

having choices are the opposite of conforming to standards

permalink
report
parent
reply
0 points

To conform to a standard or do something else are each a choice. If you can justify your choice then perhaps it’s a good one.

permalink
report
parent
reply
8 points
*

This standard makes your software’s paths user-configurable, giving users a choice.

permalink
report
parent
reply
10 points

Well, when software supports this standard, you as a user have a way to not confirm to it by setting the env variables to whatever you want, even per app. So you have two choises, either use it as is or change it.

But if software doesn’t supportthe spec, there is no choise of using it. So ons choise less.

permalink
report
parent
reply
22 points

You can choose any home directory you want, as long as it’s XDG_CONFIG_HOME.

permalink
report
parent
reply
0 points

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.

permalink
report
reply
7 points

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.

permalink
report
parent
reply
6 points

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

permalink
report
parent
reply
0 points

It’s already in the name - XDG stands for X Desktop Group (nowadays freedesktop), which works on interoperability for desktop environments. In a pure shell environment (or even if you’re not running a full desktop) none of the XDG variables are defined, and especially in shell environments the default fallbacks specified by XDG are not necessarily what the operator would expect.

permalink
report
parent
reply
2 points

That name is decades old. XDG stands for “Cross Desktop Group”.

A “pure” X environment (e.g. startx xterm) also doesn’t define those variables, but many desktop environments do, just like many shell configurations do.

permalink
report
parent
reply
-20 points

But what’s the difference? It’ll be in /home anyways and I heard BSD had some issues with something that could be XDG.

permalink
report
reply
15 points
*

But what’s the difference?

I can only imagine someone asking this if they a) don’t use the terminal except if Stackexchange says they should and b) have yet to try and cleanup a system that’s acquired cruft over a few years. If you don’t care about it, then let me flip that around and ask why you care if people use XDG? The people who care about it are the people in the spaces that concern it.

Off the top of my head this matters because:

  • it’s less clutter, especially if you’re browsing your system from terminal
  • it’s a single, specified place for user specific configs, session cache, application assets, etc. Why wouldn’t such important foundational things required for running apps not be in a well defined specification? Why just dump it gracelessly in the user’s root folder outside of pure sloppy laziness?
  • it makes uninstalling apps easier
  • it makes maintenance easier
  • it makes installing on new machines easier

It’ll be in /home anyways and I heard BSD had some issues with something that could be XDG.

🙄

permalink
report
parent
reply
7 points
*

Someone asking a question doesnt merit the insult of saying they “would never ask if they used a terminal.” I have no particular dog in this fight, but not being a dick isn’t that hard.

As to using this standard, just because this is your preferred standard, doesnt mean its the only standard.

It may actually be the best now, but so were the 14 others that came before it. Your stated reasons are the same reasons as everyone agreeing to use any other standard. Consistency, predictability, automation,ease of backup/restore, etc.

What sets this standard apart from all the rest? Based on their own description, they aren’t even an official standard, just one in “very active” use.

So why this, specifically? Just because its what you’re already doing?

permalink
report
parent
reply
5 points
*

Someone asking a question doesnt merit the insult of saying they “would never ask if they used a terminal.” I have no particular dog in this fight, but not being a dick isn’t that hard.

This is true, and something that I’m working on. For some reason my brain is uncharitable in these situations and I interpret it not as a simple question but a sarcastically hostile put down in the form of a question. In this case, “Why would you be dumb and not just put things in /home”. That really is a silly interpretation of the OP question, so I apologize.

As to using this standard, just because this is your preferred standard, doesnt mean its the only standard.

Sure, but the OP was essentially asking “Why isn’t dumping everything into a user’s /home the standard? Why are you advocating for something different?”

Based on their own description, they aren’t even an official standard, just one in “very active” use.

There are a LOT of “unofficial standards” that are very impactful. System D can be considered among those. The page you link to does talk about a lot of specifications, but it also says that a lot of them are already under the XDG specification or the reason for XDG is to bring such a scheme under a single specification, i.e. XDG.

So why this, specifically? Just because its what you’re already doing?

  • yes I do use it, so I am definitely biased in that regard
  • it bring a bunch of disparate mostly abandoned specification into a single, active one
  • it’s the active specification that has learned from past attempts
permalink
report
parent
reply
-1 points

Weird to me that you apparently think the only way of viewing files is in a terminal

permalink
report
parent
reply
2 points
*

It’s weird to me that you think I think that. I do primarily browse files by terminal, but not always. Before I got into heavy terminal use I was a power user of Nemo. In any case, dumping everything in /home does not make for a better gui file browsing experience, either

permalink
report
parent
reply
3 points

To give one example, what if someone wants to have more than one set of options for the same app? That’s something I’ve needed before, and it’s really hard to accomplish if the app always looks in one specific place for its options.

permalink
report
parent
reply
2 points

Oh so it makes it impossible to change config path? Yea that’s a bit inconvenient but you always can just make many files and replace the file in the right directory with the one you want.

permalink
report
parent
reply
3 points

Not if you want to use both at the same time. Due example, I’ve wanted to have a local Gnome session that I leave signed in, and another session with different settings that I remote into.

permalink
report
parent
reply
30 points

For me personally I just hate that I do not know where to find configs, especially when using a dotfiles repo, it becomes harder than if they’re all available under a common path.

permalink
report
parent
reply
28 points

Better organization and backup / restore. For example if you want to restore config files but don’t want to move over the large “.local” folder, applications that write to $HOME will create diifculty.

permalink
report
parent
reply
22 points

Because, like /etc, you know there is a designated place for config files. It’s already set for you right there, and there is a standard for it.

permalink
report
parent
reply
-1 points
*

/etc is a standard, defined in the filesystem hierarchy standard. This is not:

freedesktop.org produces specifications for interoperability, but we are not an official standards body. There is no requirement for projects to implement all of these specifications, nor certification.

Below are some of the specifications we have produced, many under the banner of ‘XDG’, which stands for the Cross-Desktop Group.

Its nit-picking, but this is a specification, i.e a preference, not an official standard. It would be great if everyone would agree on just one of these to use, but that isn’t a foregone conclusion. Even the actual standard, the FHS, isn’t followed by popular OS’s like NixOS.

permalink
report
parent
reply
16 points

Specification, WHATEVER 🙄

The point is it exists for a reason, and clear purpose.

permalink
report
parent
reply
-8 points

/etc can’t be edited on immutable distros and usually apps store the editable config in /home/config and make the /etc one kind of read-only.

permalink
report
parent
reply
4 points
*

In this case it would be XDG_CONFIG_HOME=/home/config. That simple.

permalink
report
parent
reply
12 points
*

/etc can’t be edited on immutable distros

False on at least Fedora Atomic[1], NixOS[2] and openSUSE Aeon[3]

Which ‘immutable’ distros are you referring to?


  1. On Fedora Atomic, changing /etc is literally identical to how it goes any other distro; or at least 1-to-1 as on traditional Fedora. The bonus is that a pristine copy of the original /etc is kept inside a sub-directory of /usr. Furthermore, all changes compared to the pristine copy are kept track of.
  2. On NixOS, changes have to be applied through configuration.nix. Though, regardless, it’s effectively possible to edit and populate /etc like it is on other distros.
  3. It’s explicitly mentioned that /etc does not belong to the immutable base.
permalink
report
parent
reply
116 points

Golang puts shit specifically in $HOME/go. Not even .go. Just plain go.

Why is it so difficult to follow industry standards

permalink
report
reply
25 points

That’s what happens when you don’t set $GOPATH I think

permalink
report
parent
reply
52 points

That doesn’t make it better.

permalink
report
parent
reply
9 points

It makes it insofar better to me that you have the option to change it. You can’t change Mozilla programs to use anything but .mozilla (apart from modifying the source code of course) so for me seeing the folder is at least a way of telling me that the variable is unset.

The better question is which folder is suited the best to store the stuff that goes into $GOPATH

permalink
report
parent
reply
20 points

Of course, but that’s not the point. There should be a sane default, and there isn’t one

permalink
report
parent
reply
-1 points
Deleted by creator
permalink
report
parent
reply
15 points

What I want in $HOME are the following directories:

If I’m on a GUI-based environment:

  • Desktop
  • Documents
  • Downloads

In general:

  • .local
  • my_junk_folder_i_made

I’d like everything else to live within something like ~/.local thanks

permalink
report
parent
reply
8 points
*

Maybe Linux should have .local and .roaming folders like Windows. local = only useful on this system, roaming = good to sync across systems. Config would be in .roaming if it’s not machine-specific.

permalink
report
parent
reply
13 points
*

Go pisses me off with that. I separate projects the way I want but go wants every project written in go in one big directory?

permalink
report
parent
reply
2 points

I really didn’t like this either. It’s quite surprising, because the rest of Go tooling is quite nice. Not having a venv, or at least something like pnpm-style node_modules is weird

permalink
report
parent
reply
1 point

Why would go have a virtual environment or dep tree like node_modules equivalent, it’s not interpreted or dynamically linked.

With modules, dependencies can be vendored.

permalink
report
parent
reply
6 points

Google

following industry standards

pick one

permalink
report
parent
reply
1 point

This post literally links to the leading one.

permalink
report
parent
reply
5 points

off the shelf go was too annoying for me

Nowadays I set GOENV_ROOT to an XDG location and use goenv instead.

permalink
report
parent
reply

Linux

!linux@lemmy.ml

Create post

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

Community stats

  • 6.8K

    Monthly active users

  • 6.6K

    Posts

  • 181K

    Comments