Skip to content

Instantly share code, notes, and snippets.

@codemodify
Created March 30, 2019 19:00
Show Gist options
  • Save codemodify/8040b85f1a732b459b417be65ca3a889 to your computer and use it in GitHub Desktop.
Save codemodify/8040b85f1a732b459b417be65ca3a889 to your computer and use it in GitHub Desktop.
ArchLinux-Bash-Prompt.sh
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
parse_git_branch2() { git describe --contains --all HEAD 2>/dev/null; }
PS1="\n[\u | \d \@ | \e[38;0;41m\w\e[0m \e[30;1;47m\$(parse_git_branch)\e[0m] \n-> "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment