summaryrefslogtreecommitdiff
path: root/roles/shell
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@fretlink.com>2018-11-13 01:01:36 +0100
committerIsmaël Bouya <ismael.bouya@fretlink.com>2018-11-13 01:01:36 +0100
commita19180dfda49b96ff27911a71255ea3a504c4bb1 (patch)
treed33419cdf0534f7aaf259a4d85e5c707ba2016ee /roles/shell
parentd0a835a44b3fd25267c3c8c6d3ed12e1e628816b (diff)
downloadAnsible-a19180dfda49b96ff27911a71255ea3a504c4bb1.tar.gz
Ansible-a19180dfda49b96ff27911a71255ea3a504c4bb1.tar.zst
Ansible-a19180dfda49b96ff27911a71255ea3a504c4bb1.zip
Move bashrc temporary file to state dir
Diffstat (limited to 'roles/shell')
-rw-r--r--roles/shell/bash/templates/bash_profile.j22
-rw-r--r--roles/shell/bash/templates/bashrc.j24
2 files changed, 4 insertions, 2 deletions
diff --git a/roles/shell/bash/templates/bash_profile.j2 b/roles/shell/bash/templates/bash_profile.j2
index 9b9e86c..8ffd818 100644
--- a/roles/shell/bash/templates/bash_profile.j2
+++ b/roles/shell/bash/templates/bash_profile.j2
@@ -4,7 +4,7 @@
4{% if "graphical_vt" in features.get(profile, []) %} 4{% if "graphical_vt" in features.get(profile, []) %}
5 5
6if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then 6if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
7 [[ -f "$HOME/.bashrc_temp" ]] && rm -f $HOME/.bashrc_temp 7 [[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && rm -f $XDG_STATE_HOME/bash/bashrc_temp
8 exec startx $XDG_CONFIG_HOME/xinitrc > $XDG_STATE_HOME/xsession_errors 2>&1 8 exec startx $XDG_CONFIG_HOME/xinitrc > $XDG_STATE_HOME/xsession_errors 2>&1
9fi 9fi
10{% endif %} 10{% endif %}
diff --git a/roles/shell/bash/templates/bashrc.j2 b/roles/shell/bash/templates/bashrc.j2
index fff19f7..91334b7 100644
--- a/roles/shell/bash/templates/bashrc.j2
+++ b/roles/shell/bash/templates/bashrc.j2
@@ -2,7 +2,7 @@
2# ~/.bashrc 2# ~/.bashrc
3# 3#
4 4
5[[ -f "$HOME/.bashrc_temp" ]] && . $HOME/.bashrc_temp 5[[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && . $XDG_STATE_HOME/bash/bashrc_temp
6 6
7if [ -n "$HOME/.local/bin" ]; then 7if [ -n "$HOME/.local/bin" ]; then
8 PATH="$HOME/.local/bin:$PATH" 8 PATH="$HOME/.local/bin:$PATH"
@@ -137,6 +137,8 @@ PS1='\[\033[01;31m\]$(error_code)\[\033[00;00m\]$(running_jobs)\[\033[01;32m\]$(
137PS1='\[\033[01;31m\]$(error_code)\[\033[00;00m\]$(running_jobs)\[$(git_prompt_color)\]$(git_prompt)\[\033[00;32m\]\u@\h\[\033[94m\] \w \$\[\033[00m\] ' 137PS1='\[\033[01;31m\]$(error_code)\[\033[00;00m\]$(running_jobs)\[$(git_prompt_color)\]$(git_prompt)\[\033[00;32m\]\u@\h\[\033[94m\] \w \$\[\033[00m\] '
138{% endif %} 138{% endif %}
139 139
140PROMPT_COMMAND="[[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && . $XDG_STATE_HOME/bash/bashrc_temp"
141
140{% if "nodejs" in features.get(profile, []) %} 142{% if "nodejs" in features.get(profile, []) %}
141source /usr/share/nvm/init-nvm.sh 143source /usr/share/nvm/init-nvm.sh
142{% endif %} 144{% endif %}