Add final fallback case

This commit is contained in:
2025-04-25 17:29:44 -03:00
parent 396627f4cb
commit 6b56f14ffa
2 changed files with 10 additions and 4 deletions

View File

@ -6,11 +6,14 @@
# Workaround for SSH/Login sessions
# https://github.com/systemd/systemd/issues/7641#issuecomment-680694017
set -a
if shopt -q login_shell && [[ -f /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator ]]; then
set -a
eval "$(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)"
set +a
# Fallback to to manually parsing environment.d
elif [[ -n "$XDG_DATA_HOME" && -n "$XDG_CONFIG_HOME" && -n "$XDG_STATE_HOME" && -n "$XDG_CACHE_HOME" ]]; then
eval "$(<"$HOME/.config/environment.d/xdg.conf")"
fi
set +a
# If we have local bash-completion, use it
[[ -f $HOME/.local/bin/bash_completion ]] && . "$HOME/.local/bin/bash_completion"

View File

@ -6,11 +6,14 @@
# Workaround for SSH/Login sessions
# https://github.com/systemd/systemd/issues/7641#issuecomment-680694017
set -a
if [[ -o login || -f /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator ]]; then
set -a
eval "$(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)"
set +a
# Fallback to to manually parsing environment.d
elif [[ -n "$XDG_DATA_HOME" && -n "$XDG_CONFIG_HOME" && -n "$XDG_STATE_HOME" && -n "$XDG_CACHE_HOME" ]]; then
eval "$(<"$HOME/.config/environment.d/xdg.conf")"
fi
set +a
autoload -Uz promptinit
autoload -Uz compinit