Skip to content

Instantly share code, notes, and snippets.

@KellerFuchs
Last active July 28, 2017 15:54
Show Gist options
  • Save KellerFuchs/f7c13b20df5ec833b7e960446bb75fa8 to your computer and use it in GitHub Desktop.
Save KellerFuchs/f7c13b20df5ec833b7e960446bb75fa8 to your computer and use it in GitHub Desktop.
BIGSQUEAKERBOX Bash prompt
_hostname=( bigsqueakerbox compooter lightningtrappedinpoisonedglass )
_user_1=( loud soft big smol kyuuuut )
_user_2=( shekken shekkie squeak )
sample() {
local n=$((RANDOM % $# +1))
echo "${!n}"
}
prompt() {
BORING_PS1="$(sample ${_user_1[@]})$(sample ${_user_2[@]})@$(sample ${_hostname[@]})"
PS1=
for ((i=0; i < ${#BORING_PS1}; ++i)); do
PS1+="\[\033[38;5;$((RANDOM & 255))m\]${BORING_PS1:$i:1}"
done
}
export PROMPT_COMMAND=prompt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment