News for hackers. Stuff that matters.
Re:Dotfile Madness by bee_rider on Sunday October 23, 2022 @08:25PM (#33311668)
Eh, I dunno. XDG is just some group or whatever, dropping config files in .programname is the de-facto community standard. If people want to follow XDG that's fine, but I can't blame anybody who wants to ignore all that noise.
Re:Dotfile Madness by slondr on Sunday October 23, 2022 @08:31PM (#33311710)
XDG has real practical benefits, though.
Re:Dotfile Madness by fiddlerwoaroof on Sunday October 23, 2022 @10:57PM (#33312526)
I personally hate the XDG directories. It’s annoying for different part of an application’s data to be split between `~/.config`, `~/.Cache`, etc. Rather than for all the data for the `foo` program to be in a file named something like `~/.foo*`
Re:Dotfile Madness by kragen on Sunday October 23, 2022 @11:08PM (#33312585)
I find it useful; I might want to version-control .config but definitely not .cache. And if the program is broken I might blow away .cache but not .config.
Re:Dotfile Madness by fiddlerwoaroof on Sunday October 23, 2022 @11:22PM (#33312649)
That still works if it’s `~/.foo/cache`
Re:Dotfile Madness by Macha on Monday October 24, 2022 @08:14AM (#33315687)

    rm -r ~/.foo/cache ~/bar/cache ~/baz/data/app/cache [20 more apps..]
is less ergonomic than

    rm -r ~/.cache/\*
Re:Dotfile Madness by Macha on Monday October 24, 2022 @11:31AM (#33318028)
I think HN escaped the * in that final line before I edited it into a code block and my edit window is expired so I can't fix it
Re:Dotfile Madness by fiddlerwoaroof on Monday October 24, 2022 @11:34AM (#33318070)
There’s always:

    rm -rf ~/.*/cache
Re:Dotfile Madness by Macha on Monday October 24, 2022 @11:49AM (#33318291)
Assumes the app uses cache as it's cache, rather than names like dlcontent, bananas_content, storage.sqlite, assets, meta, $TIMESTAMP.txt etc.
Re:Dotfile Madness by fiddlerwoaroof on Monday October 24, 2022 @12:34PM (#33318905)
Well, I don’t mind standards, I just prefer all the files an app touches to be under a single root folder (that’s not just $HOME)
Re:Dotfile Madness by jsmeaton on Sunday October 23, 2022 @11:24PM (#33312662)
Asked out of ignorance, but do the envvars not allow one to easily co-locate data/config/cache by setting them all to the same value?
Re:Dotfile Madness by fiddlerwoaroof on Sunday October 23, 2022 @11:54PM (#33312783)
Not in a way that would be useful here, I think: I prefer ~/.firefox/cache to ~/.cache/firefox and this requires the variables being unique per program (although, you could probably wrap each program with a script that sets the relevant environment variables to achieve this effect)
Re:Dotfile Madness by jsmeaton on Monday October 24, 2022 @05:57AM (#33314656)
I was thinking along the lines of ~/.data/{prog} without requiring further subdirs. The config, data, and cache would all coexist within the same directory per program

Each of the data, config, and cache envvars would all be set to ~/.data in this setup (though “data” isn’t a name I’d use)

Re:Dotfile Madness by codedokode on Monday October 24, 2022 @12:54AM (#33313062)
It is convenient because you can delete ~/.cache any time without losing configuration files.
Re:Dotfile Madness by hyperupcall on Sunday October 23, 2022 @08:45PM (#33311785)
strongly disagree - as of 2022, more apps follow the XDG Base Directory Specification than not - in fact, by a wide margin. So by "doing dirty" in your users home directory, you're going against the grain of the ecosystem.

It doesn't seem like you understand much about the specification? I'd recommend reading it, or at least a short summary I've made available here: https://xdgbasedirectoryspecification.com/

Re:Dotfile Madness by kragen on Sunday October 23, 2022 @11:07PM (#33312578)
My home directory has dotfiles for aspell, bash, bzr, cargo, Clojure, CPAN, CVS, Darcs, D-BUS, Dillo, DOSBox, DOSEmu, Emacs, Eclipse, Emacs, ESD, FLTK, fontconfig, FontForge, GForth, GHC, the GIMP, Git, GnuPG, Gnuplot, Guix, IceWM, Idle, Java, John the Ripper, Jython, Links2, MilkyTracker, Mozilla (Firefox), MPlayer, Nethack, Octave, Racket, R, Skeinforge, Slic3r, SSH, SQLite, Subversion, Units, Vim, W3M, WINE, X-Windows, XScreenSaver, and zsh, which is 51 "apps". Some of those have been there since last millennium, and it would not improve my user experience for those "apps" to look for my configuration file in two different places, or to stop looking in the place they've been looking for decades.

There are another 41 things in .config, including Bitcoin, Calibre, Chromium, DjVuLibre, Gomuks, htop, Inkscape, Mumble, OpenSCAD, Transmission, and other things. If I had to choose, I would say that those are the things "going against the grain of the ecosystem". But I think it's fine. As long as it doesn't change in another ten years to be .Config, or .conf, or Configuration, or either Configuration or Configuración depending on whether I installed the machine in English or Spanish. Because then I am seriously going to look into government surplus cruise missiles.

Re:Dotfile Madness by guilherme-puida on Monday October 24, 2022 @12:10AM (#33312854)
> it would not improve my user experience for those "apps" to look for my configuration file in two different places

Some of those already do, though. At least Vim and Emacs do, and I personally have zsh in .config as well.

Re:Dotfile Madness by kragen on Monday October 24, 2022 @12:35AM (#33312961)
Yeah, Emacs looking in both .emacs and .emacs.d has been a headache from time to time.
Re:Dotfile Madness by guilherme-puida on Monday October 24, 2022 @12:37AM (#33312972)
Isn't .emacs.d still in your $HOME? I thought the path was $XDG_CONFIG_HOME/emacs
Re:Dotfile Madness by kragen on Monday October 24, 2022 @12:39AM (#33312983)
Oh, is it doing that too, now? Ugh. Three possibilities is worse than two.
Re:Dotfile Madness by hyperupcall on Monday October 24, 2022 @09:24PM (#33325003)
Yeah I sympathize with you - my goal is for the Linux community to use a system - that is, a well-defined one, not one born arbitrarily out of the (`if (name[0] == ".") file_hidden = true;` code that has since metastasized into an ungodly manifestation of chaos itself. And that good system is the XDG Base Directory Specification. I'm sure as you know, Unix systems in general have a bad history of ad-hoc protocols and conventions, and in the process of correcting for those, somethings going to be disrupted. I've done my part to ensure that a config location that exists will continue to be looked at, but as you mention, it's confusing and increases complexity. I'm sorry, but that is what I'm willing to risk to fix this particular underlying issue.
Re:Dotfile Madness by kragen on Tuesday October 25, 2022 @11:21AM (#33331796)
I do not share your fear of chaos or your faith in rational planning over ad-hoc protocols and conventions. Have you considered that the system you are looking for is perhaps not any kind of Unix, but maybe something like Plan 9, Macintosh System 7, PalmOS, or Oberon?
Re:Dotfile Madness by blueflow on Monday October 24, 2022 @08:36AM (#33315868)
"Everybody else does it" is not an argument.
Re:Dotfile Madness by hyperupcall on Monday October 24, 2022 @09:14PM (#33324925)
If you read the parent comment, then you would know that I'm correcting the claim that not using XDG Base Dir Spec is the de-facto standard. It's not, so I'm simply stating that
Re:Dotfile Madness by pigbearpig on Sunday October 23, 2022 @09:42PM (#33312118)
XDG is like four env vars. Doesn’t seem like much noise.
[dead]
Re:Dotfile Madness by claytongulick on Sunday October 23, 2022 @10:02PM (#33312231)
There's no call for that. I don't have the ability to flag, @dang or others?
Re:Dotfile Madness by dang on Wednesday October 26, 2022 @03:25AM (#33340784)
Posting like this will get you banned on HN. No more of this, please, regardless of how strongly you feel about config files.

Also, would you please stop posting unsubstantive/flamebait comments more generally? It's not what this site is for, and it destroys what it is for.

https://news.ycombinator.com/newsguidelines.html

Re:Dotfile Madness by alwillis on Sunday October 23, 2022 @11:04PM (#33312556)
If people want to follow XDG that's fine, but I can't blame anybody who wants to ignore all that noise.

Literally every program I’ve installed for the last several months--WezTerm, Neovim, bat, broot and many more just use XDG by default. Most of the time, the user doesn’t have to do anything, though they might initially be confused if they’re looking for their config files.

Re:Dotfile Madness by scintill76 on Sunday October 23, 2022 @11:09PM (#33312587)
> XDG is just some group

vs

> the de-facto community standard

Feels like you’re just selectively defining “community” to exclude XDG. Maybe there’s a good reason, but you haven’t really described it.

Whoever defined $HOME as a place to stick configuration files was also “just some group.”

Re:Dotfile Madness by blueflow on Monday October 24, 2022 @08:59AM (#33316050)
Freedesktop (new name for XDG) is not the community. They are some people with a bad reputation when it comes to software quality and maintenance.
Re:Dotfile Madness by chimprich on Monday October 24, 2022 @10:27AM (#33317095)
> XDG is just some group or whatever

So are ISO, W3C, IETF, etc.

> dropping config files in .programname is the de-facto community standard

Dropping litter and open-air defecation are de-facto community standards in some unfortunate parts of the world. That's not an argument to keep doing it.