4 ms·
Maybe your profile location ought to be something that you're able to set through chsh
by clhodapp 4y ago
Maybe your profile location ought to be something that you're able to set through chsh
- yjftsjthsd-h 4y agoHuh. So I was about to disagree because that felt like a kludge, but actually you're right; setting your shell and its environment are both things that have to be set before the user's normal environment is working for bootstrapping reasons, so yeah, it does make perfect sense to cover both with the same mechanism. Or maybe to make it more generic we could replace the "shell" line in passwd with a "login command" entry, which is always executed by the system /bin/sh with the system environment from /etc/profile? Then you could set it to `XDG_CONFIG_HOME=$HOME/mydotfiles /bin/shell`, or `/bin/decrypt-my-home; export XDG_CONFIG_HOME=$HOME/Library/config; exec /bin/bash --init-file $HOME/Library/bash/bashrc` or whatever you want.
- codetrotter 4y agoThere is a system-wide /etc/profile or /etc/profile.d/ Likewise, zsh will look for /etc/zshrc And zsh will actually look at $ZDOTDIR/.zshenv $ZDOTDIR/.zprofile $ZDOTDIR/.zshrc $ZDOTDIR/.zlogin $ZDOTDIR/.zlogout So perhaps you can set the value of ZDOTDIR in one of the systemwide locations to use "$HOME/foo/bar/zsh/" and this way zsh will use ~/foo/bar/zsh/ as the location for the user specific .zshrc and other mentioned files for every user https://eng.libretexts.org/Bookshelves/Computer_Science/Operating_Systems/Linux_-_The_Penguin_Marches_On_(McClanahan)/02%3A_User_Group_Administration/5.03%3A_System_Wide_User_Profiles/5.03.1%3A_System_Wide_User_Profiles%3A_etc-profile https://eng.libretexts.org/Bookshelves/Computer_Science/Oper... https://bash.cyberciti.biz/guide/Setting_system_wide_shell_options https://bash.cyberciti.biz/guide/Setting_system_wide_shell_o... https://zsh.sourceforge.io/Intro/intro_3.html https://zsh.sourceforge.io/Intro/intro_3.html
- clhodapp 4y agoYep! On my real systems, my configured shell is a wrapper which sets ZDOTDIR and execs zsh from my nix profile.