6

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?

fixer1234
  • 28,064

3 Answers3

8

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

2

A way that works for me is using ~/.pam_environment.

Use man pam_env.conf for reference.

I just need some user paths added to PATH in a GNOME/Wayland session and added the following line to ~/.pam_environment.

PATH        OVERRIDE=${HOME}/bin:${HOME}/.local/bin:${PATH}
totoro
  • 121
  • 3
0

There is no way to do this in Wayland yet.

Dot files like .pam_environment, .profile, and obviously .xinitrc are ignored.

The closest way to do this would be to add a line like below to the bottom of your ~/.bashrc file (assuming you're using bash) and then setting your terminal emulator to launch on startup.

[[ $ENVSETUP != 0 ]] && export ENVSETUP=0 && exit

This would make your terminal open when you login, but immediately close. Then all your environment variables defined in the .bashrc would be set-up.