Cleaning up the whole $HOME/<.pkgname>/ situation for individual app settings

3 years ago by promitheas to c/linux

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.

Thanks!

hschen 18 points 3 years ago

https://wiki.archlinux.org/..., 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

path: 0 509571, hotness: undefined, score: 18, children: 3
devfuuu 9 points 3 years ago

I've seen developers complain that xdg is not a true standard and it only works on linux, which at that point I wanna start slapping people around.

path: 0 509571 510012, hotness: undefined, score: 9, children: 2
OsrsNeedsF2P 9 points 3 years ago

I've seen this too, but as someone who's submitted patches to 5+ projects to fix the pathing, not once has it been rejected

path: 0 509571 510012 510484, hotness: undefined, score: 9, children: 1
NuclearDolphin 1 point 3 years ago

Thank you for your service o7

path: 0 509571 510012 510484 529876, hotness: undefined, score: 1, children: 0
dannym 14 points 3 years ago path: 0 510470, hotness: undefined, score: 14, children: 2
Dirk 4 points 3 years ago

Only valid answer.

path: 0 510470 511209, hotness: undefined, score: 4, children: 1
SigHunter 3 points 3 years ago

No because Op's question is, what about those who do not confine to xdg config home?

path: 0 510470 511209 516917, hotness: undefined, score: 3, children: 0
KindaABigDyl 13 points 3 years ago

No. Some applications won't change even if you'd make the PR for them, simply because they don't want to change legacy features.

For instance, the bash maintainers have refused to put .bashrc into .config/ and to even allow the option to move it.

xdg ninja can help move some stuff out of your home dir tho

path: 0 514376, hotness: undefined, score: 13, children: 1
SuperRyn 1 point 3 years ago

"For instance, the bash maintainers have refused to put .bashrc into .config"

it's forkin' time

path: 0 514376 551503, hotness: undefined, score: 1, children: 0
doomkernel 11 points 3 years ago

There this program call xdg-ninja which tells you how to change the settings of various packages that live in $HOME.

Is not a perfect though because you'll have to do all changes manually but its the best I can think about. Hope its helps!

path: 0 509892, hotness: undefined, score: 11, children: 0
underisk 9 points 3 years ago path: 0 509749, hotness: undefined, score: 9, children: 0
sqraw 8 points 3 years ago

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.

path: 0 509274, hotness: undefined, score: 8, children: 2
Klaymore 7 points 3 years ago

Yeah, Nix(OS) with Home-Manager is great for managing dotfiles. Impermanence is also nice but a bit more complicated.

path: 0 509274 510051, hotness: undefined, score: 7, children: 0
Sharmat 3 points 3 years ago

Adding VanillaOS as well, saw it a few days ago and it seems like a pretty decent immutable distro too.

path: 0 509274 514677, hotness: undefined, score: 3, children: 0
TootSweet 7 points 3 years ago

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//.config/someapp on the host to /home//.someapp in the container.

path: 0 509647, hotness: undefined, score: 7, children: 2
knfrmity 8 points 3 years ago

I run as much as I can in Docker for this reason among others.

path: 0 509647 514752, hotness: undefined, score: 8, children: 0
jntesteves 2 points 3 years ago

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

cc @knfrmity@lemmygrad.ml

path: 0 509647 528914, hotness: undefined, score: 2, children: 0
Klaymore 7 points 3 years ago

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.

path: 0 510129, hotness: undefined, score: 7, children: 1
cyanarchy 2 points 3 years ago

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.

path: 0 510129 517105, hotness: undefined, score: 2, children: 0
jerrimu 4 points 3 years ago

You can specify that in most setups, I’d reinstall and try that. Backing up your .config to git is super easy.

path: 0 511973, hotness: undefined, score: 4, children: 0
igorlogius 3 points 3 years ago
path: 0 510022, hotness: undefined, score: 3, children: 0
_HR_ 3 points 3 years ago

Not an immediate, but longterm solution: ask app developers to respect $XDG_CONFIG_HOME and XDG Base Directory Specification in general.

And spread the knowledge about the spec, awareness of it helps.

path: 0 509295, hotness: undefined, score: 3, children: 0
pruneaue 3 points 3 years ago

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

path: 0 510488, hotness: undefined, score: 3, children: 1
promitheas 4 points 3 years ago

I decided to go with chezmoi because of its simplicity and multi-machine design from the get-go. It seems the best option for me atm

path: 0 510488 510922, hotness: undefined, score: 4, children: 0
yingleheimerschitz 3 points 3 years ago path: 0 548130, hotness: undefined, score: 3, children: 0
stepan 2 points 3 years ago

This tool can help you with certain programs that requires some extra steps to use .config/

path: 0 509813, hotness: undefined, score: 2, children: 0
bOt -6 points 3 years ago
path: 0 509823, hotness: undefined, score: -6, children: 0
linux
linux

@lemmy.ml

login for more options
68094
9452
5309

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

go to feed...