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
13 export HISTFILE="$XDG_STATE_HOME/bash/history"
16 alias ls='ls --color=auto -F -T 0'
17 alias tmux='tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf'
19 alias grep='grep --color=auto'
20 alias fgrep='fgrep --color=auto'
21 alias egrep='egrep --color=auto'
27 alias psp="pstree -aUp $USER"
28 alias dotdrop="dotdrop --cfg $XDG_CONFIG_HOME/dotdrop/config.yaml"
30 {%@@ if role.get(profile) == "fretlink" @@%}
31 ##### Some Fretlink aliases
32 alias getDump='s3cmd -c <(pass show Travail/Fretlink/S3) get '
35 TMPFILE=$(mktemp /tmp/openvpn.XXXXXX)
36 pass show Travail/Fretlink/OpenVPN >> $TMPFILE
41 function dev_prompt() {
42 if [ -n "$FRETLINK_ENV" ]; then
43 echo "{$FRETLINK_ENV} "
49 # Non-printable chars need to be wrapped by \[ ... \] otherwise bash
50 # will wrongly count the size of the prompt and glitch when going
52 function git_prompt_color() {
53 git diff --quiet 2>/dev/null && git diff --cached --quiet 2>/dev/null
55 if [ "$gitstatus" -gt 0 ]; then
63 function git_prompt() {
64 gitinfo=$(git branch 2>/dev/null | grep "^*" | cut -c3-);
65 git diff --quiet 2>/dev/null && git diff --cached --quiet 2>/dev/null
67 gitlsfiles=$(git ls-files . 2>/dev/null | wc -l);
68 if [ "$gitinfo" -a "$gitlsfiles" -gt 0 ]; then
73 function error_code() {
75 if [[ $ret != 0 ]]; then
80 function running_jobs() {
82 if [[ $ret != 0 ]]; then
87 {%@@ if role.get(profile) == "fretlink" @@%}
88 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\] '
90 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\] '
93 {%@@ if "nodejs" in features.get(profile, []) @@%}
94 source /usr/share/nvm/init-nvm.sh