improve git prompt

This commit is contained in:
SALVI Jérémie
2024-08-16 16:49:50 +02:00
parent c4eb95dd6e
commit ef7eec8b8e
3 changed files with 10 additions and 18 deletions

View File

@@ -27,21 +27,12 @@ fi
# exec Hyprland --i-am-really-stupid
#fi
_git () {
if git branch > /dev/null 2>&1
then
printf "\e[48;5;069;38;5;063m\e[00m\e[48;5;069m"
printf "  %s " "$(awk '{print $2}' <<< "$(git branch)")"
printf "\e[00m\e[38;5;069m\e[00m"
else
printf "\e[38;5;063m\e[00m"
fi
}
. /usr/local/share/dotfiles/scripts/git.sh
PS1="\n\[\e[48;5;027m\] \u \[\e[00m\]\[\e[48;5;033;38;5;027m\]\[\e[00m\]"
PS1="\n\[\e[48;5;027m\] \u \[\e[00m\]\[\e[48;5;033;38;5;027m\]\[\e[00m\]"
PS1+="\[\e[48;5;033m\] \h \[\e[00m\]\[\e[48;5;063;38;5;033m\]\e[00m\]"
PS1+="\[\e[48;5;063m\] \w \[\e[00m\]"
PS1+="\$(_git) "
PS1+="\[\e[48;5;063m\] \w \[\e[00m\]\[\e[48;5;069;38;5;063m\]\e[00m\]"
PS1+="\[\e[48;5;069m\]\$(_git) \[\e[00m\]\[\e[38;5;069m\]\e[00m\] "
# You may comment the following lines if you won't `ls' to be colorized:
eval "$(dircolors)"