Variables color, prompt
This commit is contained in:
parent
ab46714371
commit
39894df7d3
29
_bashrc
29
_bashrc
@ -29,6 +29,16 @@ if [ "$TERM" != "dumb" ]; then
|
|||||||
[ -x /usr/bin/dircolors ] && eval "`dircolors -b`"
|
[ -x /usr/bin/dircolors ] && eval "`dircolors -b`"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
GREEN='\[\033[0;32m\]'
|
||||||
|
GREENB='\[\033[1;32m\]'
|
||||||
|
RED='\[\033[0;31m\]'
|
||||||
|
REDB='\[\033[1;31m\]'
|
||||||
|
BLUE='\033[0;34m\]'
|
||||||
|
BLUEB='\033[1;34m\]'
|
||||||
|
WHITE='\[\033[0;37m\]'
|
||||||
|
WHITEB='\[\033[1;37m\]'
|
||||||
|
RESET='\[\033[0;00m\]'
|
||||||
|
|
||||||
##### FUNCTIONS #####
|
##### FUNCTIONS #####
|
||||||
|
|
||||||
# status indicator
|
# status indicator
|
||||||
@ -36,11 +46,10 @@ prompt_status()
|
|||||||
{
|
{
|
||||||
if [[ "$?" == "0" ]]
|
if [[ "$?" == "0" ]]
|
||||||
then
|
then
|
||||||
echo -n '\[\033[1;32m\]>'
|
echo -n "${GREENB}-"
|
||||||
else
|
else
|
||||||
echo -n '\[\033[1;31m\]X'
|
echo -n "${REDB}X"
|
||||||
fi
|
fi
|
||||||
echo -n '\[\033[1;31m\]'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
##### INCLUDES #####
|
##### INCLUDES #####
|
||||||
@ -89,9 +98,15 @@ export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
|
|||||||
|
|
||||||
##### PROMPT #####
|
##### PROMPT #####
|
||||||
|
|
||||||
PS1_pre="\[\033[1;31m\]>> \[\033[01;37m\](\[\033[0;37m\]\u@\[\033[0;32m\]\h\[\033[01;37m\]) \[\033[01;34m\]\w\[\033[00m\]"
|
__ps1()
|
||||||
PS1_post="\[\033[1;31m\]$(prompt_status)>\[\033[0;37m\] "
|
{
|
||||||
PS1="${PS1_pre}\n${PS1_post}"
|
ps1pre="$1"
|
||||||
|
ps1post="$2"
|
||||||
|
PS1="$ps1pre$ps1post"
|
||||||
|
}
|
||||||
|
PS1pre='"${REDB}>> ${WHITEB}(${WHITE}\u@${GREEN}\h${WHITEB}) ${BLUEB}\w${RESET}"'
|
||||||
|
PS1post='"\n$(prompt_status)${REDB}>${WHITE} "'
|
||||||
|
PROMPT_COMMAND="__ps1 $PS1pre $PS1post"
|
||||||
|
|
||||||
##### GIT #####
|
##### GIT #####
|
||||||
|
|
||||||
@ -110,6 +125,6 @@ if [ -e /usr/local/share/git-core/contrib/completion/git-prompt.sh ] || [ -e /us
|
|||||||
export GIT_PS1_SHOWUNTRACKEDFILES=1
|
export GIT_PS1_SHOWUNTRACKEDFILES=1
|
||||||
export GIT_PS1_SHOWUPSTREAM="auto"
|
export GIT_PS1_SHOWUPSTREAM="auto"
|
||||||
export GIT_PS1_SHOWCOLORHINTS=1
|
export GIT_PS1_SHOWCOLORHINTS=1
|
||||||
export PROMPT_COMMAND='__git_ps1 "$PS1_pre" "\n$PS1_post"'
|
PROMPT_COMMAND="__git_ps1 $PS1pre $PS1post"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user