summaryrefslogtreecommitdiff
path: root/roles/shell/bash/templates/bashrc.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/shell/bash/templates/bashrc.j2')
-rw-r--r--roles/shell/bash/templates/bashrc.j220
1 files changed, 13 insertions, 7 deletions
diff --git a/roles/shell/bash/templates/bashrc.j2 b/roles/shell/bash/templates/bashrc.j2
index 08518c9..b717f0e 100644
--- a/roles/shell/bash/templates/bashrc.j2
+++ b/roles/shell/bash/templates/bashrc.j2
@@ -27,7 +27,7 @@ alias mv="mv -i"
27alias cp="cp -i" 27alias cp="cp -i"
28alias rm="rm -i" 28alias rm="rm -i"
29alias psp="pstree -aUp $USER" 29alias psp="pstree -aUp $USER"
30alias dotdrop="dotdrop --cfg $XDG_CONFIG_HOME/dotdrop/config.yaml" 30alias info='info -v active-link-style=yellow,bold -v link-style=yellow'
31 31
32[[ -f /usr/share/stgit/completion/stgit-completion.bash ]] && . /usr/share/stgit/completion/stgit-completion.bash 32[[ -f /usr/share/stgit/completion/stgit-completion.bash ]] && . /usr/share/stgit/completion/stgit-completion.bash
33 33
@@ -125,6 +125,7 @@ function git_prompt() {
125 echo -e "($gitinfo) " 125 echo -e "($gitinfo) "
126 fi 126 fi
127} 127}
128{% set ps1_git = '\[$(git_prompt_color)\]$(git_prompt)' %}
128 129
129function error_code() { 130function error_code() {
130 ret=$? 131 ret=$?
@@ -139,14 +140,19 @@ function running_jobs() {
139 echo "[$ret] " 140 echo "[$ret] "
140 fi 141 fi
141} 142}
143{% set ps1_status = '\[\\033[01;31m\]$(error_code)\[\\033[00;00m\]$(running_jobs)' -%}
142 144
143{% if role.get(profile) == "fretlink" %} 145{# Ensure new line before the prompt #}
144PS1='\[\033[01;31m\]$(error_code)\[\033[00;00m\]$(running_jobs)\[\033[01;32m\]$(dev_prompt)\[$(git_prompt_color)\]$(git_prompt)\[\033[00;32m\]\u@\h\[\033[94m\] \w \$\[\033[00m\] ' 146{% set ps1_newline = '$(printf "%$((`tput cols`-1))s\\r")' -%}
145{% else %} 147
146PS1='\[\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\] ' 148{% set ps1_other = '' %}
147{% endif %} 149{% if role.get(profile) == "fretlink" -%}
150 {% set ps1_other = '\[\\033[01;32m\]$(dev_prompt)' %}
151{%- endif %}
152
153PS1='{{ ps1_newline }}{{ ps1_status }}{{ ps1_other }}{{ ps1_git }}\[\033[00;32m\]\u@\h\[\033[94m\] \w \$\[\033[00m\] '
148 154
149PROMPT_COMMAND="[[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && . $XDG_STATE_HOME/bash/bashrc_temp" 155PROMPT_COMMAND="[[ -f $XDG_STATE_HOME/bash/bashrc_temp ]] && . $XDG_STATE_HOME/bash/bashrc_temp"
150 156
151{% if "nodejs" in features.get(profile, []) %} 157{% if "nodejs" in features.get(profile, []) %}
152source /usr/share/nvm/init-nvm.sh 158source /usr/share/nvm/init-nvm.sh