3 ms·
I have this set in /etc/environment and it's working fine for me.
by HMH 5y ago
I have this set in /etc/environment and it's working fine for me.
- JonathanBeuys 5y agoOh wow, I never heard about /etc/environment. At which occasions does it get executed?
- HMH 5y agoAt login via pam, see man 5 environment for details: https://www.man7.org/linux/man-pages/man5/pam_env.conf.5.html https://www.man7.org/linux/man-pages/man5/pam_env.conf.5.htm...
- chousuke 5y agoSo environment variables on Linux are tricky business; basically, the answer depends on how your desktop session is set up. Usually, PAM will load environment variables during session initialization; I'm pretty sure that's the thing that reads /etc/environment. See man pam_env; though whether it works depends on whether that module is enabled in your PAM configuration. You can also have other things read environment variables. If a user systemd instance is launched that starts the rest of your session, that will load environment variables from various places (it also affects things launched indirectly through it, eg. via D-Bus, that can't inherit your environment from the shell) The "last" level in a typical GUI session is the shell in your terminal which will read the "traditional" files, but they aren't usually very useful for GUI applications because the GUI applications generally aren't started from any process that has a shell in its ancestry nowadays.
- perihelions 5y agoAlso ~/.config/environment.d/ (equivalent, but user-local). Wiki for the curious: https://wiki.archlinux.org/title/environment_variables#Per_user https://wiki.archlinux.org/title/environment_variables#Per_u...