fish: Set environment for non systemd user services/applications

Environment variables in environment.d directory only affects the users
systemd unit. For example, while these environment variables are set in
tmux which we start via systemd, these are not set when we open terminal
outside of tmux.

See related,
https://github.com/systemd/systemd/issues/7641
This commit is contained in:
Sanchayan Maity 2024-11-14 23:07:56 +05:30
parent 717d096d5b
commit b47a94f3e5
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -57,6 +57,8 @@ function __fish_setup_on_tty_login --description "Set up environment on tty logi
# Required for all environment variables to be set correctly, especially # Required for all environment variables to be set correctly, especially
# in tmux session service. # in tmux session service.
dbus-update-activation-environment --systemd --all dbus-update-activation-environment --systemd --all
export $(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)
end end
# Instead of tty check, we would have liked to do this using status is-login # Instead of tty check, we would have liked to do this using status is-login