Skip to content

Instantly share code, notes, and snippets.

@dapierce
Last active June 22, 2017 03:44
Show Gist options
  • Save dapierce/620a100ec9eeb30384514b45f9bf90dd to your computer and use it in GitHub Desktop.
Save dapierce/620a100ec9eeb30384514b45f9bf90dd to your computer and use it in GitHub Desktop.
My custom .bash_profile for macOS
# oldbashprofile:
#export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
# πŸ’πŸ’πŸ’ cool stuff πŸ’πŸ’πŸ’
# randomize emoji/colors every new terminal window tab
emojis=(🐯 🐷 🐡 🐼 😺 πŸ’ πŸ• 🌯 πŸ‘ πŸ₯‘ πŸ” πŸ₯“)
emoji=${emojis[$RANDOM % 12]}
# if in a git repo, show the branch
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# on fire if previous command failed
function success {
if [ $? == 0 ];
then
echo $emoji
else
echo πŸ”₯
fi
}
export PS1="\e[48;5;50m \$(success)\e[30;48;5;50m \t \033[m\]\[\033[36m\] \u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\] \w\[\033[m\] \e[3;93m\$(parse_git_branch)\e[0m\n\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
#alias ls='ls -GFh'
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment