Package: gnome-shell
Version: 48.1-1

I can't change the PATH at gnome-shell level so I can execute programs in
my `~/bin` or `~/.local/bin` folder from my `.desktop` files. I am able to
easily define other variables through
`~/.config/environment.d/envvars.conf` e.g. `TEXMFHOME`. The problem is
reported elsewhere and most recently on these pages:

-
https://www.reddit.com/r/archlinux/comments/i2ybvc/cant_change_path_in_environmentd5/
- https://gitlab.gnome.org/GNOME/gdm/-/issues/385
-
https://gitlab.gnome.org/GNOME/gdm/-/commit/349e6af855a1c1dbee9af3e5881e00b66482d155

I have changed these files:
```sh
~/.bashrc :
export PATH="$HOME/.local/bin:$PATH"

~/.config/environment.d/envvars.conf:
PATH=$HOME/.local/bin:$PATH
TEXMFHOME=$HOME/.texmf # this variable is available at gnome-shell level

~/.pam_environment
PATH        OVERRIDE=${HOME}/bin:${HOME}/.local/bin:${PATH}

/etc/environment
PATH=/home/farid/.local/bin:$PATH
```
And at my bash prompt in gnome-terminal, I get:
```sh
~$
/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator
GTK_MODULES=gail:atk-bridge:gail:atk-bridge
QT_ACCESSIBILITY=1
PATH=/home/farid/.local/bin:/home/farid/.local/bin:/home/farid/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PYTHONSTARTUP=/home/farid/.python_startup
GCC_COLORS="error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01"
VISUAL="vi EDITOR=vi SYSTEMD_EDITOR=vi"
TEXMFHOME=/home/farid/.texmf
TEXMFCNF=/home/farid/.texmf/web2c:/home/farid/.texmf/web2c:


~$ systemctl --user show-environment
HOME=/home/farid
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LOGNAME=farid
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
SHELL=/bin/bash
USER=farid
XDG_RUNTIME_DIR=/run/user/1000
GTK_MODULES=gail:atk-bridge
QT_ACCESSIBILITY=1
PYTHONSTARTUP=/home/farid/.python_startup
GCC_COLORS=$'error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
VISUAL=vi
TEXMFHOME=/home/farid/.texmf
TEXMFCNF=/home/farid/.texmf/web2c:
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DESKTOP_SESSION=gnome
DISPLAY=:0
EDITOR=vi
GDMSESSION=gnome
GDM_LANG=en_US.UTF-8
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/64064a9f_0993_4156_8610_1df4e8733ddb
GNOME_TERMINAL_SERVICE=:1.92
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GPG_TTY=/dev/pts/0
GROFF_NO_SGR=1
```

The `TEXMFHOME` variable set in `~/.config/environment.d/envvars.conf` file
is available to Gnome-shell but PATH seems to be overridden by some program.
I am not sure if it's related to systemd or Gnome-shell, But in the reddit
link I shared above, a person says the problem stems from  Gnome-shell.
I expect that when I press alt+f2 and type an executable name which is
present in `~/.local/bin/` to be executed.

I reported the bug to Debian gnome-shell package maintainers as well:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1104035

If I press `ALT+F2` and execute `sh -c 'echo "$PATH" > /tmp/path'`, then
the content of /tmp/path is:
```
cat /tmp/path
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
```

If I press `ALT+F2` and execute `sh -c 'echo "$TEXMFHOME" >
/tmp/TEXMFHOME'`, which is defined in
`~/.config/environment.d/envvars.conf`, then:
```
cat /tmp/TEXMFHOME
/home/farid/.texmf
`

Reply via email to