gnome 3.22: how to change the PATH for the shell?

0

It seems gnome 3.22 has changed how it gets its $PATH. In previous versions I think either the .bashrc or the .bash_profile were taken into account. Now they're not anymore. I also tried ~/.profile to no avail.

To test it, I ran alt-f2, the command name, and enter. It does not work now on gnome 3.22 unless the executable is in the folders in the normal $PATH of the system (/usr/bin and so on). It caused me an issue of not displaying an app in the menus anymore because it could not find its executable. Changing to the absolute path in the desktop file fixed the issue, but I'd like to tell gnome-shell about the folder and enter the executable name only; I'd rather not copy the app to system-wide folders like /usr/bin.

Emmanuel Touzery

Posted 2016-11-25T08:33:09.933

Reputation: 377

It seems that you just need to restart your session. You can see if the $PATH is updated by launching a terminal end issuing 'echo $PATH' command – mestia – 2016-11-25T08:36:35.927

don't think so, tried logging out and back in, to gdm. do you mean I need a full reboot? – Emmanuel Touzery – 2016-11-25T08:37:22.387

Place the PATH into /etc/environment, this way it will be system-wide, also see this question http://unix.stackexchange.com/questions/81243/how-do-i-set-the-path-or-other-environment-variables-so-that-x-apps-can-access-i

– mestia – 2016-11-25T08:40:14.117

but i would like NOT to make it system-wide. I want it only for my user. – Emmanuel Touzery – 2016-11-25T08:45:35.750

I did not check .pam_environment yet, which is at the link you give @mestia. I'll try it ASAP (but I can't log out right now) – Emmanuel Touzery – 2016-11-25T08:46:39.813

actually it seems .pam_environment won't work on fedora => http://unix.stackexchange.com/questions/81243/how-do-i-set-the-path-or-other-environment-variables-so-that-x-apps-can-access-i#comment547503_81274 so I'm still without solution

– Emmanuel Touzery – 2016-11-25T11:45:12.893

Answers

0

I found out this problem is covered in https://unix.stackexchange.com/questions/317282/set-environment-variables-for-gnome-on-wayland-and-bash-on-virtual-terminals-or and https://bugzilla.gnome.org/show_bug.cgi?id=736660 and https://bugzilla.redhat.com/show_bug.cgi?id=1149905

Unfortunately none of the links give a satisfying solution right now. I'll update if I find a good one.

Emmanuel Touzery

Posted 2016-11-25T08:33:09.933

Reputation: 377

Sigh. 2019 and my Debian Bullseye is playing up. .profile is sourced TWICE on login leading to double PATHs. I put the PATH into .zshrc and made zsh my default shell but gnome doesnt exec that for the shell on login. Gah what a mess. – RichieHH – 2020-02-12T14:39:55.197