Linux – How to set environment variables for a Gnome Wayland session

arch linuxenvironment-variablesgdmgnome3wayland

It seems that a Gnome Wayland session ignores the file ~/.profile. At least it is not working for me under a Gdm / Gnome / wayland session with Arch Linux.

So the question is, what is the proper user file to use for environment variables for a gnome-wayland session? Does Wayland even support those kind of settings?

Best Answer

Systemd version 233 (March 2017) added support for setting environment variables in ~/.config/environment.d/*.conf. See the environment.d man page and the discussion that led to the feature on this preliminary PR and this final one.

Also discussed here: https://unix.stackexchange.com/a/403196/23305

Related Question