Last active
October 15, 2019 11:55
-
-
Save angel-vladov/02b1f2f6c9cbdddd95a324c84ac4ead1 to your computer and use it in GitHub Desktop.
Manjaro Gnome bash with Git branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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