Skip to content

Instantly share code, notes, and snippets.

@angel-vladov
Last active October 15, 2019 11:55
Show Gist options
  • Save angel-vladov/02b1f2f6c9cbdddd95a324c84ac4ead1 to your computer and use it in GitHub Desktop.
Save angel-vladov/02b1f2f6c9cbdddd95a324c84ac4ead1 to your computer and use it in GitHub Desktop.
Manjaro Gnome bash with Git branch
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\]\h\[\033[01;36m\] \W\[\033[01;31m\]\[\033[00;37m\]$(git_branch 2>/dev/null)\[\033[01;32m\]\$\[\033[00m\] '
else
PS1='\[\033[01;32m\]\u@\h\[\033[01;37m\] \W\[\033[01;32m\]\[\033[00;37m\]$(git_branch 2>/dev/null)\[\033[01;32m\]\$\[\033[00m\] '
fi
# Include in .bashrc using
# [[ -f ~/.bash_prompt ]] && . ~/.bash_prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment