fix(sway): Load .config/environment.d/envvars.conf in another way

This commit is contained in:
2025-01-10 18:41:18 +01:00
parent 6f2e18367f
commit b16702c28e
3 changed files with 50 additions and 22 deletions

View File

@ -1,10 +1,28 @@
# .profile permet d'avoir
# 1. TERMINAL (choix d'un terminal par défaut)
# 2. BATPATH (pour la batterie)
# 3. PATH initial # TODO: vraiment nécessaire ?
emulate sh -c '. ~/.profile'
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
# TODO: vérifier si ce code commenté fonctionne
#export PYENV_ROOT="$HOME/.pyenv"
#export PATH="$PYENV_ROOT/bin:$PATH"
#eval "$(pyenv init --path)"
# Start X automatically
if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
case $HOST in
roc | zou)
: # Exceptions : On ne fait rien pour ces machines qui sont sous Xorg.
;;
*)
# Pour toutes les autres on charge le contenu de .config/environment.d
# Cf. https://wiki.archlinux.org/title/Environment_variables#Per_Wayland_session
# use systemd-environment-d-generator(8) to generate environment, and export those variables
set -o allexport
source <(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)
set +o allexport
;;
esac
exec sway
fi