Skip to content

Instantly share code, notes, and snippets.

@kraftwerk28
Created April 8, 2019 13:11
Show Gist options
  • Save kraftwerk28/ae8b47d08a05e0e20c2f17e3fc2d50c0 to your computer and use it in GitHub Desktop.
Save kraftwerk28/ae8b47d08a05e0e20c2f17e3fc2d50c0 to your computer and use it in GitHub Desktop.
function _brc_parse_git_branch_ {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
echo "(${BRANCH})"
fi
}
function _brc_parse_branch_status_ {
if [[ $(git status --short) ]]
then
echo " ✗"
fi
}
export PS1="\
\[\e[32m\][\[\e[1;92m\]\u@Esskeetit\
\[\e[0;97m\]:\[\e[32;94m\]\W\[\e[32m\]]\
\[\e[91m\]\`_brc_parse_branch_status_\` \
\[\e[0;93m\]\`_brc_parse_git_branch_\` \
\[\e[1;91m\]λ=\[\e[0m\] \
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment