Live data from Hacker News

Use the XDG Base Directory Specification

xdgbasedirectoryspecification.com

71–80 of 214 posts

Re: Use the XDG Base Directory Specification

#72
A couple of years ago I wanted to use xdg dirs in a Python app I was writing. There are seemingly two packages for this, neither of which I could get to work.

Overall I don't think xdg dirs on Linux are really as amazing as some people think. For example it is said that one can just back up the config dir to carry all the configuration over to the next install, but apps often dump the default configuration into the config dir, which you don't want to carry to the next install (which will have different versions, so probably a different default config) because that might break stuff. In the end you have to carefully look over all the configuration to see what's worthwhile to take with you, and it doesn't really matter if that's in ~/.appname or ~/.config/appname

Re: Use the XDG Base Directory Specification

#73
post #42

Oh I‘m fighting the battle for a clean home directory for years. I even use a setup on macOS to set specific environment variables via systemd during login so I can link them into the .config directory. Only issue with my setup in general is that I can‘t just replicate it for other people. I moved .aws directory in .config/aws and I sometimes forget what the default for most tools is or where I helped the tool out to…

macOS + systemd? If on Linux this tool allows you to move config dir and file locations transparently. Pretty neat. https://github.com/queer/boxxy

Re: Use the XDG Base Directory Specification

#74
Oh yeah, I used to do that and diligently configured vim and others apps to use $XDG_{DATA_HOME,CONFIG_HOME}. Lots of razor cuts and more maintenance annoyances, not worth the time. I reverted to using the defaults on each new machine I configure these days.

Re: Use the XDG Base Directory Specification

#75
post #53

XDG specs are crap. Sure one single ~/.config folder is a very good idea. But I want it clearly visible such as ~/config. But I don't want an additional and confusing ~/.local. Plus I don't want ~/Videos or ~/Pictures folders. I am not dumb. Let me organize my folders according to my needs and my will. The first thing I do when I setup a user account is removing those useless XDG folders. XDG pretend to remove folder…

> I want it clearly visible such as ~/config. No problems: define the $XDG_CONFIG_HOME to be like so. > I don't want an additional and confusing ~/.local. The idea is that data and config are different. Anyway, if you have different taste, that's ok, define $XDG_DATA_HOME to be the same as config. > I don't want ~/Videos or ~/Pictures folders That's not in the XDG spec.

> That's not in the XDG spec.

But it is. In the XDG user dir spec.

Re: Use the XDG Base Directory Specification

#77

I'd say for windows, you'd probably want to define them as well since a lot of ports will use HOME, XDG_* and other non-windowsy environment variables anyhow.

Those are shitty ports. The worst are those who will plop something in a dot file in your home directory. They don't get hidden on windows, people!

Re: Use the XDG Base Directory Specification

#78

I have a very dumb question: why does the article use `find` with `printf` and depth specification, as opposed to the simpler `ls -a`? I'm assuming it has something to do with portability, but `ls -a` is already in POSIX. I'm a bit confused.

Hmm. I think it's because `ls -a` will not visually differentiate between files and folders and will also show `.`and `..`. and will span contents over columns while find will return a line by found items.

Or they are a show-off.

Re: Use the XDG Base Directory Specification

#79

Earlier quoted context omitted.

Luckily if you’re a developer on MacOS, you can have that too! In addition to ~/.config and a million .dotfiles and .dotdirectories from decades of unixy tools! Truly a cornucopia.

It's frustrating enough to make a person seriously consider maintaining forks of all the FOSS things they use to fix this one bit of misbehavior.

Do any of the Linux distros do this? Strikes me as the kind of thing Debian would do for everything in apt
Post reply on HN