4

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?

  • Try this. – Insane Oct 27 '15 at 1:30
  • 2
    gnome-wayland session ignores my ~/.profile file. But , the gnome-x11 session works fine with that file. – user5491487 Oct 27 '15 at 1:53
  • Did you ever find an answer? I have the same issue. It's vaguely mentioned here. – totoro Oct 9 '16 at 14:54
4

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

| improve this answer | |
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}
| improve this answer | |
  • 1
    this does not work in wayland. – RichieHH Aug 11 at 18:06
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.

| improve this answer | |
  • This is outdated, see the other answers. – Doron Behar Jul 30 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.