5 if [ -n "$HOME/.local/bin" ]; then
6 PATH="$HOME/.local/bin:$PATH"
9 # If not running interactively, don't do anything
10 [[ $- != *i* ]] && return
12 export HISTFILE="$XDG_STATE_HOME/bash/history"
15 alias ls='ls --color=auto -F -T 0'
16 alias tmux='tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf'
18 alias grep='grep --color=auto'
19 alias fgrep='fgrep --color=auto'
20 alias egrep='egrep --color=auto'
26 alias psp="pstree -aUp $USER"
27 alias dotdrop="dotdrop --cfg $XDG_CONFIG_HOME/dotdrop/config.yaml"
29 {%@@ if role.get(profile) == "fretlink" @@%}
30 ##### Some Fretlink aliases
31 alias getDump='s3cmd -c <(pass show Travail/Fretlink/S3) get '
34 TMPFILE=$(mktemp /tmp/openvpn.XXXXXX)
35 pass show Travail/Fretlink/OpenVPN >> $TMPFILE
40 function dev_prompt() {
41 if [ -n "$FRETLINK_ENV" ]; then
42 echo "{$FRETLINK_ENV} "
48 # Non-printable chars need to be wrapped by \[ ... \] otherwise bash
49 # will wrongly count the size of the prompt and glitch when going
51 function git_prompt_color() {
52 git diff --quiet 2>/dev/null && git diff --cached --quiet 2>/dev/null
54 if [ "$gitstatus" -gt 0 ]; then
62 function git_prompt() {
63 gitinfo=$(git branch 2>/dev/null | grep "^*" | cut -c3-);
64 git diff --quiet 2>/dev/null && git diff --cached --quiet 2>/dev/null
66 gitlsfiles=$(git ls-files . 2>/dev/null | wc -l);
67 if [ "$gitinfo" -a "$gitlsfiles" -gt 0 ]; then
72 function error_code() {
74 if [[ $ret != 0 ]]; then
79 function running_jobs() {
81 if [[ $ret != 0 ]]; then
86 {%@@ if role.get(profile) == "fretlink" @@%}
87 PS1='\[\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\] '
89 PS1='\[\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\] '
92 {%@@ if "nodejs" in features.get(profile, []) @@%}
93 source /usr/share/nvm/init-nvm.sh