Skip to content

Instantly share code, notes, and snippets.

@carlesjove
Last active August 29, 2015 14:07
Show Gist options
  • Save carlesjove/a98abf4a9e21532bbca7 to your computer and use it in GitHub Desktop.
Save carlesjove/a98abf4a9e21532bbca7 to your computer and use it in GitHub Desktop.
My Funny Prompt
# 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"';
@carlesjove
Copy link
Author

I mostly copied it form different sources. You better know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment