283
submitted 5 months ago by bahmanm@lemmy.ml to c/linux@lemmy.ml

Shameless plug: I am the author.

top 50 comments
sorted by: hot top controversial new old
[-] dinckelman@lemmy.world 116 points 5 months ago

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

Why is it so difficult to follow industry standards

[-] Laser@feddit.org 31 points 5 months ago

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

[-] fmstrat@lemmy.nowsci.com 52 points 5 months ago

That doesn't make it better.

[-] Laser@feddit.org 13 points 5 months ago

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

[-] fmstrat@lemmy.nowsci.com 7 points 5 months ago

Just because something is worse, doesn't make the other thing good. A sane and standard default, as others have mentioned, is a small bar to meet.

[-] dinckelman@lemmy.world 20 points 5 months ago

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

[-] atzanteol@sh.itjust.works 11 points 5 months ago* (last edited 5 months ago)

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?

load more comments (3 replies)
load more comments (11 replies)
[-] dan@upvote.au 67 points 5 months ago

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

[-] PureTryOut@lemmy.kde.social 10 points 5 months ago

Strange that some apps allow configuring it rather than just doing it automatically...

load more comments (1 replies)
load more comments (2 replies)
[-] Mechanize@feddit.it 49 points 5 months ago

I wish they used them all, especially XDG_CACHE_HOME which can become pretty big pretty fast.

[-] MonkderDritte@feddit.de 12 points 5 months ago

And i wish there was a separate XDG_LOG_HOME or $HOME/.local/log, with logrotate preconfigured to look there.

load more comments (1 replies)
[-] Wispy2891@lemmy.world 36 points 5 months ago* (last edited 5 months ago)

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

[-] lockhart@lemmy.ml 10 points 5 months ago

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

load more comments (4 replies)
[-] Telorand@reddthat.com 27 points 5 months ago

I didn't know about this (and thankfully, haven't written anything public). I've been trying to fix an install script for an OSS project that doesn't work on immutable distros, and using the XDG Base Directory specs might just be the panacea I was looking for!

[-] MonkderDritte@feddit.de 22 points 5 months ago* (last edited 5 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

[-] Samueru@lemmy.ml 16 points 5 months ago
[-] Xylight@lemm.ee 22 points 5 months ago

I regret checking this

load more comments (13 replies)
[-] dohpaz42@lemmy.world 14 points 5 months ago

Here is a more concise way to achieve the same thing:

ls -ACd ~/.??*/ | sed -e "s#$HOME/##g"
load more comments (3 replies)
[-] davel@lemmy.ml 11 points 5 months ago

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.

[-] exu@feditown.com 25 points 5 months ago

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

[-] davel@lemmy.ml 7 points 5 months ago

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.

[-] hallettj@leminal.space 25 points 5 months ago

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.

load more comments (1 replies)
[-] hallettj@leminal.space 24 points 5 months ago

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.

[-] eager_eagle@lemmy.world 11 points 5 months ago* (last edited 5 months ago)

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

I have headless machines with XDG vars configured and ones without them. XDG compliant software works in either case, but I'm less likely to use a piece of software that clutters my $HOME.

[-] avidamoeba@lemmy.ca 11 points 5 months ago

My fellow FOSS users, patches are welcome.

[-] refalo@programming.dev 11 points 5 months ago

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

https://xkcd.com/927

[-] Telorand@reddthat.com 23 points 5 months ago

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

[-] hallettj@leminal.space 15 points 5 months ago

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.

load more comments (9 replies)
[-] chip@feddit.rocks 8 points 5 months ago

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.

load more comments (1 replies)
[-] mactan@lemmy.ml 10 points 5 months ago

there's no place like 127.0.0.1

there's no place like XDG_CONFIG_HOME.

[-] GolfNovemberUniform@lemmy.ml 7 points 5 months ago

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

[-] dotslashme@infosec.pub 29 points 5 months ago

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.

[-] mrvictory1@lemmy.world 27 points 5 months ago

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.

[-] just_another_person@lemmy.world 22 points 5 months ago

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.

load more comments (15 replies)
[-] SmokeInFog@midwest.social 17 points 5 months ago* (last edited 5 months ago)

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.

🙄

[-] mosiacmango@lemm.ee 10 points 5 months ago* (last edited 5 months ago)

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?

load more comments (1 replies)
load more comments (3 replies)
load more comments (3 replies)
[-] aard@kyu.de 6 points 5 months ago

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.

[-] eager_eagle@lemmy.world 9 points 5 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.

[-] sparr@lemmy.world 6 points 5 months ago

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

load more comments (2 replies)
load more comments
view more: next ›
this post was submitted on 14 Jul 2024
283 points (100.0% liked)

Linux

48681 readers
302 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