5 [[ -f "$XDG_STATE_HOME/bash/bashrc_temp" ]] && . $XDG_STATE_HOME/bash/bashrc_temp
7 if [ -n "$HOME/.local/bin" ]; then
8 PATH="$HOME/.local/bin:$PATH"
11 # If not running interactively, don't do anything
12 [[ $- != *i* ]] && return
15 export HISTFILE="$XDG_STATE_HOME/bash/history"
16 export HISTTIMEFORMAT='%F %T '
17 export HISTCONTROL="ignorespace:ignoredups"
20 alias ls='ls --color=auto -F -T 0'
21 alias tmux='tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf'
23 alias grep='grep --color=auto'
24 alias fgrep='fgrep --color=auto'
25 alias egrep='egrep --color=auto'
31 alias psp="pstree -aUp $USER"
32 alias info='info -v active-link-style=yellow,bold -v link-style=yellow'
34 if [[ -d "$XDG_DATA_HOME/bash_completion" ]]; then
35 for i in $XDG_DATA_HOME/bash_completion/*; do
36 [[ -f "$i" && -r "$i" ]] && . "$i"
40 {% if role.get(profile) == "fretlink" %}
41 ##### Some Fretlink aliases
43 alias tmux_dev=fl_tmux_dev
44 complete -o filenames -F _fl_tmux_dev tmux_dev
46 function dev_prompt() {
47 if [ -n "$FRETLINK_ENV" ]; then
48 echo "{$FRETLINK_ENV} "
52 if [ -n "$TMUX" ]; then
53 TMUX_SESSION_NAME=$(tmux display-message -p "#S")
54 export HISTFILE="$XDG_STATE_HOME/bash/tmux_${TMUX_SESSION_NAME}_history"
57 function load_dev_env() {
61 FL_ENV="$1" source ../environment
68 # Non-printable chars need to be wrapped by \[ ... \] otherwise bash
69 # will wrongly count the size of the prompt and glitch when going
71 function git_prompt_color() {
72 git diff --quiet 2>/dev/null && git diff --cached --quiet 2>/dev/null
74 if [ "$gitstatus" -gt 0 ]; then
82 function git_prompt() {
83 gitinfo=$(git branch 2>/dev/null | grep "^*" | cut -c3-);
84 git diff --quiet 2>/dev/null && git diff --cached --quiet 2>/dev/null
86 gitlsfiles=$(git ls-files . 2>/dev/null | wc -l);
87 if [ "$gitinfo" -a "$gitlsfiles" -gt 0 ]; then
91 {% set ps1_git = '\[$(git_prompt_color)\]$(git_prompt)' %}
93 function running_jobs() {
95 if [[ $ret != 0 ]]; then
100 PROMPT_COMMAND=__prompt_command
102 __prompt_command () {
106 red="\[\033[01;31m\]"
107 bgreen="\[\033[01;32m\]"
108 green="\[\033[00;32m\]"
111 # Ensure new line before the prompt
112 PS1='$(printf "%$((`tput cols`-1))s\r")'
113 if [[ $ret != 0 ]]; then
116 PS1+='$(running_jobs)'
117 {% if role.get(profile) == "fretlink" %}
118 PS1+="$bgreen"'$(dev_prompt)'
120 PS1+='\[$(git_prompt_color)\]$(git_prompt)'
121 PS1+="$green\u@\h$blue \w \$$d "
124 {% if "nodejs" in features.get(profile, []) %}
125 source /usr/share/nvm/init-nvm.sh