Live data from Hacker News

Use the XDG Base Directory Specification

xdgbasedirectoryspecification.com

21–30 of 214 posts

Re: Use the XDG Base Directory Specification

#21
post #12

> ... State :... if the data is unique for a given machine, the file belongs [to $XDG_STATE_HOME / $HOME/.local/state] This statement is misleading/wrong. Like all other XDG stuff, it's not about the machine, it's about the particular user. Also, why does the author consider the given positive example clean and tidy, when it has files .profile and .bashrc placed directly in the user's home directory? Following the ru…

> This statement is misleading/wrong. Like all other XDG stuff, it's not about the machine, it's about the particular user.

No, it's both. The XDG state dir is for things that are also machine-specific so that, e.g., it doesn't make sense to sync them as part of your dotfiles.

> why does the author consider the given positive example clean and tidy, when it has files .profile and .bashrc placed directly in the user's home directory? Following the rules, these files should be within the .config/ directory as well.

They should! Some shells have kindly moved to follow this convention following requests from users who like it for other apps and would prefer more uniformity w/r/t config file location conventions, e.g.: https://github.com/elves/elvish/issues/383

Re: Use the XDG Base Directory Specification

#22

I strongly disagree: the dot files cause very little inconvenience because they’re typically hidden and they’re easier to type and list than the XDG spec stuff

Isn't it great that it's optional? I love how Linux is like that. We can all be happy

Except it isn't because I don't pick the configuration scheme for every program I use.

Re: Use the XDG Base Directory Specification

#23
One of the things that changed my life recently, that I hadn't seen before: NeoVim has a NVIM_APPNAME variable that lets you change the app name.

So when I wanted to try AstroVim, I just set NVIM_APPNAME=astrovim, and dropped the files in ~/.config/astrovim instead of blowing up my existing (shitty) ~/.config/nvim.

I really wish the idea of configurable appnames was a part of the spec! (or a well-known extension!)

Re: Use the XDG Base Directory Specification

#25

I strongly disagree: the dot files cause very little inconvenience because they’re typically hidden and they’re easier to type and list than the XDG spec stuff

You're in good company! Most of the apps listed used a hidden file or directory in the home directory.

Re: Use the XDG Base Directory Specification

#26

I strongly disagree: the dot files cause very little inconvenience because they’re typically hidden and they’re easier to type and list than the XDG spec stuff

i agree too, All i've seen is a mess of conflicting standards.

Is the dotfile now in ~/.local, or ~/.config or what?

Re: Use the XDG Base Directory Specification

#27

The second example is a nice start, but I'd really like to see invisible files/folders in ~/ done away with altogether. So starting with that example, I might add a visible ~/Library/ folder, then move ~/.config/ and ~/.local/ in there as ~/Library/Config/ and ~/Library/Local/ as normal visible folders. Same for .bashrc, .profile, etc; put them in ~/Library/Config/ without the dots.

Yeah, it's a bit alien on macOS. There is no good mapping for some of these folders.

For example, on macOS application configuration isn't even supposed to be done directly via application-specific files. macOS has its User Defaults subsystem, with `defaults read`/`defaults write` commands. And of course this isn't usable by typical command-line tools that don't have a Bundle ID.

Re: Use the XDG Base Directory Specification

#28

The second example is a nice start, but I'd really like to see invisible files/folders in ~/ done away with altogether. So starting with that example, I might add a visible ~/Library/ folder, then move ~/.config/ and ~/.local/ in there as ~/Library/Config/ and ~/Library/Local/ as normal visible folders. Same for .bashrc, .profile, etc; put them in ~/Library/Config/ without the dots.

What does Library actually mean though? ;)

Re: Use the XDG Base Directory Specification

#29
post #21
post #12

> ... State :... if the data is unique for a given machine, the file belongs [to $XDG_STATE_HOME / $HOME/.local/state] This statement is misleading/wrong. Like all other XDG stuff, it's not about the machine, it's about the particular user. Also, why does the author consider the given positive example clean and tidy, when it has files .profile and .bashrc placed directly in the user's home directory? Following the ru…

> This statement is misleading/wrong. Like all other XDG stuff, it's not about the machine, it's about the particular user. No, it's both. The XDG state dir is for things that are also machine-specific so that, e.g., it doesn't make sense to sync them as part of your dotfiles. > why does the author consider the given positive example clean and tidy, when it has files .profile and .bashrc placed directly in the user's…

Also Fish shell

Re: Use the XDG Base Directory Specification

#30

The second example is a nice start, but I'd really like to see invisible files/folders in ~/ done away with altogether. So starting with that example, I might add a visible ~/Library/ folder, then move ~/.config/ and ~/.local/ in there as ~/Library/Config/ and ~/Library/Local/ as normal visible folders. Same for .bashrc, .profile, etc; put them in ~/Library/Config/ without the dots.

> The second example is a nice start, but I'd really like to see invisible files/folders in ~/ done away with altogether.

A great many amazing tools shall, by default, skip searching in hidden files (and gain a great speedup thanks to doing that). You'd have to modify all these tools so that they'd skip Library/ by default.

Also, related to that, what would you do with .git/? Move prjs/fizzbuz/.git to Library/fizzbuzz/git while keeping prjs/fizzbuzz?

This is, hopefully, never going to happen.

Post reply on HN