You are not logged in.
Hi,
Yesterday I spent a lot of time looking for ways to set environment variable when running Gnome desktop. And I failed. There are multiple pages, lots of advice to set various files under '$HOME' such as:
- .xprofile
- .xinitrc
- .gnomerc from stackoverflow response
But none of that works. It is especially easy to prove if shell is set to fish, because fish does not load .profile, .bashrc files.
My setup is based on archinstall for Gnome: GDM display manager with Gnome (Wayland) and fish as user shell for non-root user account.
It seems there are new ways of dealing with things, but I am a bit confused as to when these get applied and I have not tried these options yet:
- ~/.pam_environment
- ~/.config/environment.d/*.conf
I was particulary surprised by GDM and /etc/gdm/Xsession. The file does not seem to get executed, because it starts xterm which I don't even have installed and I don't see errors in `journalctl -u gdm` logs. Is it meant to run only for XOrg session?
I'd like to know how to setup in my environment:
- environment variable for desktop and terminal session (think Console with Ctrl-Alt-F3). It would be nice if I could do it shell independent.
- environment variable for Gnome session.
Last edited by kulak (2024-03-25 17:17:14)
Offline
I think GNOME reads ~/.profile, or at least it did last time I used it. I don't use bash for my login shell though so I'm not sure if ~/.bash_profile will be used in that case.
Otherwise I use /etc/environment for most variables. That seems to work for GNOME.
Offline
Offline
This helps a lot. Thank you. I would mark it as answer if I could.
Offline
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline