X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=roles%2Fshell%2Fbash%2Ftemplates%2Fbash_profile.j2;h=f622f67556e1e684cac7b5b17b0289de639ed5b6;hb=44c40b43e46ce0fcf3e2e31fde8f27666bbd3807;hp=9b9e86c9df32bdbe80ab15988e9f14d241d146a2;hpb=c235f9bea368316f1c1a441ebf6877e05e7df21c;p=perso%2FImmae%2FConfig%2FAnsible.git diff --git a/roles/shell/bash/templates/bash_profile.j2 b/roles/shell/bash/templates/bash_profile.j2 index 9b9e86c..f622f67 100644 --- a/roles/shell/bash/templates/bash_profile.j2 +++ b/roles/shell/bash/templates/bash_profile.j2 @@ -1,10 +1,12 @@ # Some variables are loaded via pam (see .config/pam_environment) +# This file is loaded thanks to as line in /etc/profile +# test "$BASH" && test -r "$XDG_CONFIG_HOME/bash/bash_profile" && . $XDG_CONFIG_HOME/bash/bash_profile -[[ -f ~/.bashrc ]] && . ~/.bashrc +[[ -f $XDG_CONFIG_HOME/bash/bashrc ]] && . $XDG_CONFIG_HOME/bash/bashrc {% if "graphical_vt" in features.get(profile, []) %} -if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then - [[ -f "$HOME/.bashrc_temp" ]] && rm -f $HOME/.bashrc_temp +if [[ ! $DISPLAY && $XDG_VTNR -eq {{ lookup('env', "XDG_VTNR") | default(1, true) }} ]]; then + [[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && rm -f $XDG_STATE_HOME/bash/bashrc_temp exec startx $XDG_CONFIG_HOME/xinitrc > $XDG_STATE_HOME/xsession_errors 2>&1 fi {% endif %}