Cleaning up the whole $HOME/<.pkgname>/ situation for individual app settings
Hey guys! Is there a way for me to force apps to treat e.g. $HOME/.config/ as their default directory to look for settings? I want to clear up my home directory because its getting quite messy and I don't even have that many packages installed yet.
Also, any way that would be easy and efficient for use with git for the purpose of backing up my dotfiles.
https://wiki.archlinux.org/title/XDG_Base_Directory#Support, the situation is crap tbh and alot of devs refuse to even give you the option of switching to XDG standards for some reason. I started using flatpaks for most of my programs just to escape this.
I do know XDG standards are messy for devs to implement but at least have everything in .config or .local instead of spewing it across my home folder
Might be worth looking into immutable distros (nix, guix) and their home management systems, or containerised apps (flatpak, where you can inject config). A lot of tools are hardcoded to non standard locations so it's kind of a losing battle by default. A similar strategy would be to use permissions or mount certain folders as read only.
One option might be to run certain of your apps in Docker. There are ways to go about running even graphical apps in Docker. And with Docker, you can tell it to mount /home/<username>/.config/someapp on the host to /home/<username>/.someapp in the container.
This is the right way to solve the issue, because this is actually a security issue, and I think most people don't realize that.
I'm aiming to make this easier, so everybody can benefit from this approach. I haven't publicly announced it yet because I'm still missing better documentation. But it's pretty advanced already, and I could use feedback on how it performs on your use-cases: https://codeberg.org/contr/contr
What ended up happening with me was I just have all my stuff in a separate /stuff partition. That way I don't need to worry about dotfiles cluttering up my actual data. I also use NixOS Home-Manager to manage my dotfiles for things like git and vscodium.
I'm a recent transplant from windows to linux and I saw this coming. My Documents is not reserved for documents that are actually mine, I had no expectation /home would be any different, and it seems I was correct. Other than some things I want quick access to (downloads, notes, scripts) I keep everything I care about organized under /data.
Xdg-ninja that was mentioned by other people is probably the best for the main issue.
For the git stuff, look into bare git repos. Iirc distrotube has a good video explaining the concept