Skip to content

Instantly share code, notes, and snippets.

@omizzy
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omizzy/785e48f103f43da33564 to your computer and use it in GitHub Desktop.
Save omizzy/785e48f103f43da33564 to your computer and use it in GitHub Desktop.
bash colors
# Color Codes
# Black 0;30 Dark Gray 1;30
# Blue 0;34 Light Blue 1;34
# Green 0;32 Light Green 1;32
# Cyan 0;36 Light Cyan 1;36
# Red 0;31 Light Red 1;31
# Purple 0;35 Light Purple 1;35
# Brown 0;33 Yellow 1;33
# Light Gray 0;37 White 1;37
# back to foreground color 0
#bracket colors
BRACKET_COLOR=`echo $[ 30 + $[ RANDOM % 37 ]]`
RIGHT_BRACKET="\[\033[1;"$BRACKET_COLOR"m\][\[\033[0m\]"
LEFT_BRACKET="\[\033[1;"$BRACKET_COLOR"m\]]\[\033[0m\]"
PROMPT_COLOR=`echo $[ 30 + $[ RANDOM % 37 ]]`
PROMPT="\[\033[1;"$PROMPT_COLOR"m\]\$\[\033[0m\]"
HOST_COLOR=`echo $[ 30 + $[ RANDOM % 37 ]]`
HOST="\[\033[1;"$HOST_COLOR"m\]\h\[\033[0m\]"
CWD_COLOR=`echo $[ 30 + $[ RANDOM % 37 ]]`
CWD="\[\033[1;"$CWD_COLOR"m\]\w\[\033[0m\]"
USr_COLOR=`echo $[ 30 + $[ RANDOM % 37 ]]`
USr="\[\033[1;"$USr_COLOR"m\]\u\[\033[0m\]"
#set up bash promts
PS1="\n$RIGHT_BRACKET$USr@$HOST:$CWD$LEFT_BRACKET\n$PROMPT "
PS2="loop \$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment