Skip to content

Instantly share code, notes, and snippets.

@JustAdam
Last active October 1, 2015 07:29
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 JustAdam/c4074146a43ef2e3a305 to your computer and use it in GitHub Desktop.
Save JustAdam/c4074146a43ef2e3a305 to your computer and use it in GitHub Desktop.
Fruit machine PS1 prompt: origin. http://pastebin.com/dMFTr0Nk
# AUTHOR/Source : /u/Holger_Will
set_prompt (){
red="\[\033[38;5;1m\]"
green="\[\033[38;5;10m\]"
yellow="\[\033[38;5;11m\]"
grape="\[\033[38;5;92m\]"
strawberry="\[\033[38;5;9m\]"
mellon="\[\033[38;5;162m\]"
name="$red🍒$space$green🍏$space$red🍓$space$color4"
host="$color3\h$color4"
path="$color5\w$color4"
reset="\[\e[0m\]"
blink="\[\e[5;33m\]"
symbol[0]="$red🍒 $reset"
symbol[1]="$green🍏 $reset"
symbol[2]="$strawberry🍓 $reset"
symbol[3]="$grape🍇 $reset"
symbol[4]="$mellon🍉 $reset"
n1=$(($RANDOM%5))
n2=$(($RANDOM%5))
n3=$(($RANDOM%5))
win=0
winst=""
if ((($n1==$n2) || ($n1==$n3) || ($n2==$n3)));
then
win=10;
CASH=$(($CASH+$win))
winst=" $yellow⭐$reset"
fi
if ((($n1==$n2) && ($n1==$n3)));
then
win=$((100*($n1+1)));
CASH=$(($CASH+$win))
winst=" $yellow🌟 $win🌟 $reset"
fi
CASH=$(($CASH-10))
PS1="[${symbol[$n1]}${symbol[$n2]}${symbol[$n3]}]$winst $green💵 $reset:$yellow$CASH$reset $yellow📂 $path ⏩ $reset"
}
CASH=1000
PROMPT_COMMAND='set_prompt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment