Last active
August 29, 2015 14:07
-
-
Save carlesjove/a98abf4a9e21532bbca7 to your computer and use it in GitHub Desktop.
My Funny Prompt
This file contains 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
# Configure Terminal prompt | |
get_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
get_ruby_version() { | |
ruby -e "print RUBY_VERSION" | |
# If you're using rbenv and want to know | |
# the local version and not the global | |
# use this instead: | |
# rbenv version-name | |
} | |
RESET="\[\017\]" | |
NORMAL="\[\033[0m\]" | |
YELLOW="\[\033[0;33m\]" | |
CYAN="\[\033[0;36m\]" | |
GREEN="\[\033[32m\]" | |
# These will show up in an emoji compatible terminal | |
ME_EMOJI=(๐ถ ๐ฑ ๐ญ ๐น ๐ฐ ๐ธ ๐จ ๐ป ๐ท ๐ฎ ๐ต ๐ผ ๐ ๐ฃ ๐ฐ๏ธ); | |
RANDOM_ME_EMOJI=${ME_EMOJI[$((RANDOM%15))]}; | |
export PS1="$YELLOW$(get_ruby_version)$NORMAL \W$GREEN\$(get_git_branch)$NORMAL $RANDOM_ME_EMOJI "; | |
export PROMPT_COMMAND='update_terminal_cwd; echo -ne "\033]0;${RANDOM_ME_EMOJI##*/}\007"'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I mostly copied it form different sources. You better know!