Skip to content

Instantly share code, notes, and snippets.

@prestonp
Last active March 29, 2017 22:32
Show Gist options
  • Save prestonp/64bd075503bccf9c6257 to your computer and use it in GitHub Desktop.
Save prestonp/64bd075503bccf9c6257 to your computer and use it in GitHub Desktop.
dynamic emoji shell prompt
emoji() {
emojis=("🍕 " "💩 " "🐶 " "🍣 " "🍔 " "🍪 " "🐳 ")
echo ${emojis[$RANDOM % ${#emojis[@]} ]}
}
set_bash_prompt() {
# Define your prompt formatting here
export PS1="\d \t \u:\w\n$(emoji) "
}
# Terminal prompt formatting
PROMPT_COMMAND=set_bash_prompt

example

Note: This picture shows a different PS1 that includes git branch info and adds color

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