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.
Use the XDG Base Directory Specification
41–50 of 214 posts
Re: Use the XDG Base Directory Specification
#42Only 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 „find the right path“.
I also make sure when writing scripts/cli tools to use the XDG spec. In rust I use the dirs crate for example. I even go so far to never hardcode it for my own config scripts/files just in case I think about going from ~/.config to ~/.my_configurations or whatever.
Re: Use the XDG Base Directory Specification
#43Re: Use the XDG Base Directory Specification
#44Re: Use the XDG Base Directory Specification
#45It also provides an easy target for freeing disk space if you do run into issues (just `rm -r $XDG_CACHE_HOME`).
That said, I do think the spec would be improved by defining what constitutes a "user-specific data file" and how that is different from a "user-specific state file". Wouldn't "user-specific data files" just be "files" from a users perspective? I like the idea they have for this, but it's kind of under defined.
Though that's probably a good thing because no one wants a ontological tome to wade through when working on a bash script or the like.
Re: Use the XDG Base Directory Specification
#46Yes! Some projects are stuck for years trying to implement this. Firefox for example. > .audacity-data Recent Audacity already fixed this.
Re: Use the XDG Base Directory Specification
#47If you are using Rust, you can easily conform to this by using `directories` crate: https://docs.rs/directories/latest/directories/struct.BaseDi...
Re: Use the XDG Base Directory Specification
#48The 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.
If everything honored this spec, including the part where it reads environment variables to see where the different directories are, you could do that by sticking the right variables in your environment. I think the one legitimate exception to the rule is profile, because you need that in order to set the variables in the first place. So that one would somehow have to be hard coded to at least have a wider search pat…
Re: Use the XDG Base Directory Specification
#49I 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