Commit 8f640f1c authored by Johann Queuniet's avatar Johann Queuniet

Add git infos to PS1

parent 834a2441
......@@ -8,65 +8,74 @@ alias ls='ls --color=auto'
alias ip='ip --color'
alias ipb='ip --color -br'
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM=verbose
GIT_PS1_SHOWCOLORHINTS=1
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then TERM=gnome-256color; fi
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
BASE03=$(tput setaf 234)
BASE02=$(tput setaf 235)
BASE01=$(tput setaf 240)
BASE00=$(tput setaf 241)
BASE0=$(tput setaf 244)
BASE1=$(tput setaf 245)
BASE2=$(tput setaf 254)
BASE3=$(tput setaf 230)
YELLOW=$(tput setaf 136)
ORANGE=$(tput setaf 166)
RED=$(tput setaf 160)
MAGENTA=$(tput setaf 125)
VIOLET=$(tput setaf 61)
BLUE=$(tput setaf 33)
CYAN=$(tput setaf 37)
GREEN=$(tput setaf 64)
export BASE03=$(tput setaf 234)
export BASE02=$(tput setaf 235)
export BASE01=$(tput setaf 240)
export BASE00=$(tput setaf 241)
export BASE0=$(tput setaf 244)
export BASE1=$(tput setaf 245)
export BASE2=$(tput setaf 254)
export BASE3=$(tput setaf 230)
export YELLOW=$(tput setaf 136)
export ORANGE=$(tput setaf 166)
export RED=$(tput setaf 160)
export MAGENTA=$(tput setaf 125)
export VIOLET=$(tput setaf 61)
export BLUE=$(tput setaf 33)
export CYAN=$(tput setaf 37)
export GREEN=$(tput setaf 64)
else
BASE03=$(tput setaf 8)
BASE02=$(tput setaf 0)
BASE01=$(tput setaf 10)
BASE00=$(tput setaf 11)
BASE0=$(tput setaf 12)
BASE1=$(tput setaf 14)
BASE2=$(tput setaf 7)
BASE3=$(tput setaf 15)
YELLOW=$(tput setaf 3)
ORANGE=$(tput setaf 9)
RED=$(tput setaf 1)
MAGENTA=$(tput setaf 5)
VIOLET=$(tput setaf 13)
BLUE=$(tput setaf 4)
CYAN=$(tput setaf 6)
GREEN=$(tput setaf 2)
export BASE03=$(tput setaf 8)
export BASE02=$(tput setaf 0)
export BASE01=$(tput setaf 10)
export BASE00=$(tput setaf 11)
export BASE0=$(tput setaf 12)
export BASE1=$(tput setaf 14)
export BASE2=$(tput setaf 7)
export BASE3=$(tput setaf 15)
export YELLOW=$(tput setaf 3)
export ORANGE=$(tput setaf 9)
export RED=$(tput setaf 1)
export MAGENTA=$(tput setaf 5)
export VIOLET=$(tput setaf 13)
export BLUE=$(tput setaf 4)
export CYAN=$(tput setaf 6)
export GREEN=$(tput setaf 2)
fi
BOLD=$(tput bold)
RESET=$(tput sgr0)
export BOLD=$(tput bold)
export RESET=$(tput sgr0)
else
# Linux console colors. I don't have the energy
# to figure out the Solarized values
MAGENTA="\033[1;31m"
ORANGE="\033[1;33m"
GREEN="\033[1;32m"
PURPLE="\033[1;35m"
WHITE="\033[1;37m"
BOLD=""
RESET="\033[m"
export MAGENTA="\033[1;31m"
export ORANGE="\033[1;33m"
export GREEN="\033[1;32m"
export PURPLE="\033[1;35m"
export WHITE="\033[1;37m"
export BOLD=""
export RESET="\033[m"
fi
uid=$(id -u)
if [ $uid -eq 0 ]; then
usercolor=$RED
export usercolor=$RED
else
usercolor=$GREEN
export usercolor=$GREEN
fi
if [ -n "$PS1" ]; then
export PROMPT_COMMAND='__git_ps1 "\[$BASE01\]\[$usercolor\]\u\[$BASE01\]@\[$BLUE\]\h \[$CYAN\]\w\[$RESET\]" " \[$GREEN\]\\$\[$RESET\] "'
fi
[ -n "$PS1" ] && export PS1="\[$BASE01\]\[$usercolor\]\u\[$BASE01\]@\[$BLUE\]\h \[$CYAN\]\w \[$GREEN\]\$\[$RESET\] "
eval `dircolors ~/.config/dir_colors`
gpg-connect-agent /bye
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment