4 ms·
If I had the opportunity I always thought it would be fun to learn and then modify the Linux kernel so that file lookups to ~/.* get redirected to ~/config/.* a
by user3939382 6y ago
If I had the opportunity I always thought it would be fun to learn and then modify the Linux kernel so that file lookups to ~/.* get redirected to ~/config/.* and I could finally have a clean home directory.
- thewakalix 6y agoI think FUSE would be enough.
- flukus 6y agoDepending on how things are linked it might be simpler than you imagine and not involve any kernel modifications, you can do a lot of cool and/or horrifying stuff with a few environment variables: https://unix.stackexchange.com/questions/24811/changing-linked-library-for-a-given-executable-centos-6 https://unix.stackexchange.com/questions/24811/changing-link... If anything this would discourage more programs from adopting the xdg spec though.
- tomxor 6y agoI gave in trying to control the home directory long ago, it's a complete free for all, there has to be at least a dozen common and different ways programs decide to store configuration and caches etc. I install my dotfiles globally into the system for the programs I care about with a simple shell script. Our desktops/laptops are usually all single user these days anyway, I don't see the point in trying to constrain things to a home directory. The nice things about this is that I can nuke my home directory when I feel like it, this is especially useful for programs I just want to reset without figuring out where they've littered all their configs... obviously you need to keep the dotfile repo outside of the home directory for that.
- waheoo 6y agoThere is different ways people have done it but there is only one standard. Make issues on GitHub and hope for the best. Most of the time it's already a "I don't care, won't fix". Apparently people just don't care that I have .cache mapped to a tmpfs and they don't care that their cache stored in .config or .shitappdevelopersinc is thrashing my remote backups.
- AnIdiotOnTheNet 6y ago> I gave in trying to control the home directory long ago, it's a complete free for all, there has to be at least a dozen common and different ways programs decide to store configuration and caches etc. This and the security free-for-all that programs enjoy come from a simpler, more naive time in personal computing. Personally, I think one of the few things mobile OSs get right[0] is the idea that applications cannot be trusted to behave and the default should be to keep them in their own little sandbox until the user says otherwise. Launch them in their own namespace with only the things you want them to have access to mapped in or redirected as per your preference. [0] I have issues with the implementation, but the idea is sound.
- brigandish 6y agoYou might try convincing projects to adopt the XDG spec[1] instead, might be easier. Might be. I've been trying something similar using Apple's framework bundle layout[2] and using XDG to point config files to ~/Library/ApplicationSupport etc, but programmers know better! Just spray whatever files you need into my home dir, developers, be my guest… [1] https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html https://specifications.freedesktop.org/basedir-spec/latest/a... [2] https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html https://developer.apple.com/library/archive/documentation/Ma...
- BiteCode_dev 6y agoBest way to make dev do that is to make it easy for them. E.G: I used to "spray my files in the home dir" for my apps, until I discovered "appdirs" (https://pypi.org/project/appdirs/1.4.0/ https://pypi.org/project/appdirs/1.4.0/). Once I had an easy way to always has a clean and correct path for my app config/data/tmp file, I just used it.
- imhoguy 6y agoYou may try cgroups and mount namespaces with bind mounts. Alternativelly you can wrap apps in Snaps[0] yourself, or use some other app packaging/isolation concept. [0] https://ubuntu.com/blog/apps-to-snaps https://ubuntu.com/blog/apps-to-snaps
- mkesper 6y agoTried snaps on a top performance notebook. No single app was responsive when e.g. pressing right mouse button. It's just not usable, sorry.
- moonbug 6y agoLD_PRELOAD is what you want.
- saagarjha 6y agoThis would not work for statically linked software.