From ca44007cbc0b4426d0c986434529f7305b8e96e8 Mon Sep 17 00:00:00 2001 From: tavo-wasd Date: Sun, 10 Sep 2023 22:20:28 -0600 Subject: [PATCH] pimping out bash prompt --- shell/bashrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/bashrc b/shell/bashrc index 34a1169..bd1fe09 100644 --- a/shell/bashrc +++ b/shell/bashrc @@ -4,7 +4,11 @@ [[ $- != *i* ]] && return # Prompt -PS1='\[\e[0;1;91m\][\[\e[0;1;38;5;87m\]\u\[\e[0;0;38;5;123m\]@\[\e[0;0;38;5;159m\]\h \[\e[0;38;5;247m\]\w\[\e[0;1;91m\]]\n \[\e[0;38;5;247m\]$ \[\e[0m\]' +prompt_git_branch() { + GIT_BRANCH="$(git branch 2>/dev/null | grep '*' | cut -d ' ' -f 2)" + [ -n "$GIT_BRANCH" ] && printf "  %s " "$GIT_BRANCH" +} +PS1='\[\033[1m\]\[\033[46m\] \u@\h \[\033[44m\] \w \[\033[45m\]$(prompt_git_branch)\[\033[0m\] \[\033[2m\]\@\n⯈ \[\033[0m\]' PROMPT_COMMAND="echo" # Line jump after every command # General configs