PS1

This program is meant to take the pain out of generating nice bash PS1 prompts.

Pull requests welcome! And if you build an awesome theme, drop something in the examples folder!

Installation / Quickstart ↑

To install this package from pypy run the following command.


pip3 install ps1

Execute this to make your first prompt


export PS1="$(ps1 template -t parrot)"

License

See: LICENSE

Other Docs

Examples

entropy.sh

export PS1='\[\e[38;5;196m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]entropy:$(_shentropy)\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]\[\e[38;5;11m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]\[\e[38;5;10m\]\w\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;11m\]\$ \[\e[0m\]'
entropy.sh

face.sh

export PS1='\[\e[38;5;15m\]\[\e[1m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\360\237\230\235\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;248m\]\u\[\e[0m\]\[\e[38;5;15m\]@\[\e[0m\]\[\e[38;5;248m\]\h\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\360\237\230\235\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;238m\]\[\e[1m\]\w\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;15m\]\[\e[1m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;196m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;15m\]\[\e[1m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;10m\]\$ \[\e[0m\]'
face.sh

filecount.sh

export PS1='\[\e[38;5;10m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]\[\e[38;5;11m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;10m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]\[\e[38;5;196m\]fcnt:$(_fcount)\[\e[0m\]\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]\[\e[38;5;5m\]fsize:$(_dirfilesize)\[\e[0m\]\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;10m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]\[\e[38;5;196m\]\w\[\e[0m\]\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]\[\e[38;5;247m\]\u\[\e[0m\]\[\e[38;5;11m\]@\[\e[0m\]\[\e[38;5;12m\]\h\[\e[0m\]\[\e[38;5;10m\]\000\342\235\261\[\e[0m\] \[\e[38;5;10m\]\$ \[\e[0m\]'
filecount.sh

greenguy.sh

export PS1='\[\e[38;5;10m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]\[\e[38;5;247m\]\u\[\e[0m\]\[\e[38;5;11m\]@\[\e[0m\]\[\e[38;5;12m\]\h\[\e[0m\]\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]\[\e[38;5;196m\]\w\[\e[0m\]\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;10m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;10m\]\000\342\235\260\[\e[0m\]\[\e[38;5;11m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;10m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;10m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;10m\]\$ \[\e[0m\]'
greenguy.sh

ips.sh

export PS1='\[\e[38;5;196m\]\[\e[1m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;2m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]entropy:$(_shentropy)\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\[\e[1m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;11m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]ips:$(_ips)\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\[\e[1m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;33m\]\w\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\[\e[1m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;15m\]\$ \[\e[0m\]'
ips.sh

nightrider.sh

export PS1='\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\][\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;2m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\]]\[\e[0m\]\[\e[38;5;235m\]\[\e[48;5;0m\]\[\e[1m\]\000\342\210\224\[\e[0m\]\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\][\[\e[0m\]\[\e[38;5;2m\]\d \t\[\e[0m\]\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\]]\[\e[0m\]\[\e[38;5;235m\]\[\e[48;5;0m\]\[\e[1m\]\000\342\210\224\[\e[0m\]\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\][\[\e[0m\]jobs:\[\e[38;5;196m\]\j\[\e[0m\]\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\]]\[\e[0m\]\[\e[38;5;235m\]\[\e[48;5;0m\]\[\e[1m\]\000\342\210\224\[\e[0m\]\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\][\[\e[0m\]cmd#:\[\e[38;5;196m\]\#\[\e[0m\]\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\]]\[\e[0m\]\n\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\][\[\e[0m\]\[\e[38;5;33m\]\w\[\e[0m\]\[\e[38;5;241m\]\[\e[48;5;0m\]\[\e[1m\]]\[\e[0m\]\n\[\e[38;5;15m\]\$ \[\e[0m\]'
nightrider.sh

no_unicode.sh

export PS1='\[\e[38;5;196m\][\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]x\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]+\[\e[0m\]")\[\e[38;5;196m\]]\[\e[0m\]\[\e[38;5;196m\]\[\e[0m\]\[\e[38;5;196m\][\[\e[0m\]entropy:$(_shentropy)\[\e[38;5;196m\]]\[\e[0m\]\[\e[38;5;196m\]\[\e[0m\]\[\e[38;5;196m\][\[\e[0m\]\[\e[38;5;11m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;196m\]]\[\e[0m\]\n\[\e[38;5;196m\][\[\e[0m\]\[\e[38;5;10m\]\w\[\e[0m\]\[\e[38;5;196m\]]\[\e[0m\]\n\[\e[38;5;11m\]\$ \[\e[0m\]'
no_unicode.sh

parrot.sh

export PS1='\[\e[38;5;196m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]\[\e[38;5;247m\]\u\[\e[0m\]\[\e[38;5;11m\]@\[\e[0m\]\[\e[38;5;12m\]\h\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]\[\e[38;5;10m\]\w\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]\[\e[38;5;11m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;11m\]\$ \[\e[0m\]'
parrot.sh

plainjane.sh

export PS1='$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "✘/${b_err_code}" || echo "✔") \w \$'
plainjane.sh

purplegoblin.sh

export PS1='\[\e[38;5;5m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;5m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;5m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;5m\]\000\342\235\260\[\e[0m\]\[\e[38;5;247m\]\u\[\e[0m\]\[\e[38;5;11m\]@\[\e[0m\]\[\e[38;5;12m\]\h\[\e[0m\]\[\e[38;5;5m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;5m\]\000\342\235\260\[\e[0m\]\[\e[38;5;10m\]\w\[\e[0m\]\[\e[38;5;5m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;5m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;5m\]\000\342\235\260\[\e[0m\]\[\e[38;5;11m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;5m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;5m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;10m\]\$ \[\e[0m\]'
purplegoblin.sh

skulls.sh

export PS1='\[\e[38;5;15m\]\[\e[1m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\360\237\222\200\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;248m\]\u\[\e[0m\]\[\e[38;5;15m\]@\[\e[0m\]\[\e[38;5;248m\]\h\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\360\237\222\200\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;238m\]\[\e[1m\]\w\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;15m\]\[\e[1m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;196m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\360\237\222\200\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;0m\]\[\e[48;5;238m\]rando_str:$(_randstr)\[\e[0m\]\[\e[38;5;15m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;15m\]\[\e[1m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;10m\]\$ \[\e[0m\]'
skulls.sh

stev0_work.sh

export PS1='\[\e[38;5;196m\]\[\e[1m\][\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;2m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;196m\]\[\e[1m\]]\[\e[0m\]\[\e[38;5;196m\]\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\][\[\e[0m\]\[\e[38;5;244m\]entropy\[\e[0m\]:$(_shentropy)\[\e[38;5;196m\]\[\e[1m\]]\[\e[0m\]\[\e[38;5;196m\]\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\][\[\e[0m\]\[\e[38;5;2m\]\d \t\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]]\[\e[0m\]\[\e[38;5;196m\]\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\][\[\e[0m\]\[\e[38;5;244m\]jobs\[\e[0m\]:\[\e[38;5;196m\]\j\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]]\[\e[0m\]\[\e[38;5;196m\]\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\][\[\e[0m\]\[\e[38;5;244m\]cmd#\[\e[0m\]:\[\e[38;5;196m\]\#\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]]\[\e[0m\]\n\[\e[38;5;196m\]\[\e[1m\][\[\e[0m\]\[\e[38;5;33m\]\w\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]]\[\e[0m\]\[\e[38;5;196m\]\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\][\[\e[0m\]\[\e[38;5;11m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]]\[\e[0m\]\n\[\e[38;5;15m\]\$ \[\e[0m\]'
stev0_work.sh

too_many_options.sh

export PS1='\[\e[38;5;196m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]entropy:$(_shentropy)\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]git:\[\e[38;5;10m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]user:\[\e[38;5;10m\]\u\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]\[\e[38;5;247m\]\u\[\e[0m\]\[\e[38;5;11m\]@\[\e[0m\]\[\e[38;5;12m\]\h\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]working_dir_basename:\[\e[38;5;10m\]\W\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]working_dir:\[\e[38;5;10m\]\w\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]bash_ver:\[\e[38;5;10m\]\v\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]bash_ver_release:\[\e[38;5;10m\]\V\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]cmd#:\[\e[38;5;10m\]\#\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]hist:\[\e[38;5;10m\]\!\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]jobs:\[\e[38;5;10m\]\j\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]shell:\[\e[38;5;10m\]\s\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]term:\[\e[38;5;10m\]\l\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]host:\[\e[38;5;10m\]\h\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]host_long:\[\e[38;5;10m\]\H\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]date_24hrtime:\[\e[38;5;10m\]\d \t\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]date_wmd:\[\e[38;5;10m\]\d\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]12hr_am_pm:\[\e[38;5;10m\]\@\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]12hr_am_pm_sec:\[\e[38;5;10m\]\T\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\000\342\235\260\[\e[0m\]time_24hrs:\[\e[38;5;10m\]\t\[\e[0m\]\[\e[38;5;196m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;11m\]\$ \[\e[0m\]'
too_many_options.sh

fire_ice.sh

export PS1='\[\e[38;5;196m\]\[\e[1m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;2m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;33m\]\u\[\e[0m\]\[\e[38;5;0m\]@\[\e[0m\]\[\e[38;5;8m\]\h\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;33m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\[\e[1m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;15m\]\[\e[48;5;33m\]\w\[\e[0m\]\[\e[38;5;196m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;196m\]\[\e[1m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;33m\]\$ \[\e[0m\]'
fire_ice.sh

magenta.sh

export PS1='\[\e[38;5;21m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;21m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;1m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;10m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;21m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;21m\]\000\342\235\260\[\e[0m\]\[\e[38;5;201m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;21m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;21m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;21m\]\000\342\235\260\[\e[0m\]\[\e[38;5;201m\]\w\[\e[0m\]\[\e[38;5;21m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;21m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;8m\]\$ \[\e[0m\]'
magenta.sh

powderpuff.sh

export PS1='\[\e[38;5;199m\]\[\e[1m\]\000\342\224\214\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;199m\]\[\e[1m\]\000\342\235\260\[\e[0m\]$(b_err_code=$?; [[ $b_err_code != 0 ]] && echo "\[\e[38;5;196m\]\000\342\234\230\[\e[0m\]/${b_err_code}" || echo "\[\e[38;5;2m\]\000\342\234\224\[\e[0m\]")\[\e[38;5;199m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;199m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;91m\]\u\[\e[0m\]\[\e[38;5;206m\]@\[\e[0m\]\[\e[38;5;8m\]\h\[\e[0m\]\[\e[38;5;199m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\[\e[38;5;196m\]\000\342\224\201\[\e[0m\]\[\e[38;5;199m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;91m\]$(br=$(git branch 2>/dev/null| grep '"'"'^\*'"'"' | awk '"'"'{print $NF}'"'"'); [[ "${br}" ]] && echo "${br}" || echo "-")\[\e[0m\]\[\e[38;5;199m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;199m\]\[\e[1m\]\000\342\224\234\000\342\224\200\000\342\224\200\[\e[0m\]\[\e[38;5;199m\]\[\e[1m\]\000\342\235\260\[\e[0m\]\[\e[38;5;15m\]\[\e[48;5;91m\]\w\[\e[0m\]\[\e[38;5;199m\]\[\e[1m\]\000\342\235\261\[\e[0m\]\n\[\e[38;5;199m\]\[\e[1m\]\000\342\224\224\000\342\224\200\000\342\225\274\[\e[0m\] \[\e[38;5;91m\]\$ \[\e[0m\]'
powderpuff.sh

PS1 Command Help

Custom

usage: ps1 custom [-h] [--add_bash_ver color title] [--add_bash_ver_release color title] [--add_cmd_num color title]
                        [--add_custom value color title] [--add_date_time_24hr color title] [--add_date_week_month_day color title]
                        [--add_exit_code ok_txt err_txt ok_color err_color title] [--add_git_branch color title]
                        [--add_hist_num color title] [--add_host color title] [--add_host_long color title] [--add_jobs color title]
                        [--add_newline] [--add_shell_name color title] [--add_term_base color title]
                        [--add_time_12hr_am_pm color title] [--add_time_12hr_with_second color title] [--add_time_24 color title]
                        [--add_user color title] [--add_user_host user_color at_sym_color host_color]
                        [--add_working_dir_basename color title] [--add_working_directory color title] [--set_delim_color value]
                        [--set_ends start end] [--set_fancy_lines] [--set_no_color value] [--set_no_ps1_escape]
                        [--set_prompt_color color] [--set_section_color color] [--set_section_delim delim] [--set_title_color value]

optional arguments:
  -h, --help            show this help message and exit
  --add_bash_ver color title
                        Add The version of Bash (e.g., 2.00).
  --add_bash_ver_release color title
                        Add The release of Bash, version + patchlevel (e.g., 2.00.0).
  --add_cmd_num color title
                        Add Number of commands this terminal has run.
  --add_custom value color title
                        Add custom section value/color.
  --add_date_time_24hr color title
                        Add the date/time, in 24-hour HH:MM:SS format.
                        ::
                            Mon Sep 13 10:28:40
  --add_date_week_month_day color title
                        Add Date week month day.
                        ::
                            Mon Sep 13
  --add_exit_code ok_txt err_txt ok_color err_color title
                        Add Exit code indicator to prompt.
  --add_git_branch color title
                        Add git branch to prompt.
  --add_hist_num color title
                        Add History count.
  --add_host color title
                        Add PS1 host expansion value.
  --add_host_long color title
                        Add PS1 host expansion value.
  --add_jobs color title
                        Add The number of jobs currently managed by the shell.
  --add_newline         Insert newline.
  --add_shell_name color title
                        Add The name of the shell, the basename of $0 (the portion following the final slash).
  --add_term_base color title
                        Add The basename of the shell's terminal device name.
  --add_time_12hr_am_pm color title
                        Add The time, in 12-hour am/pm format.
                        ::
                            10:28 AM
  --add_time_12hr_with_second color title
                        Add The time, in 12-hour HH:MM:SS format.
                        ::
                            10:28:40
  --add_time_24 color title
                        Add The time, in 24-hour HH:MM:SS format.
                        ::
                            10:28:40
  --add_user color title
                        Add PS1 user expansion value.
  --add_user_host user_color at_sym_color host_color
                        Add User/Host to prompt.
                        ::
                            [user@hostname]-[section2]
                                  ^ add this
  --add_working_dir_basename color title
                        Add The basename of $PWD.
  --add_working_directory color title
                        Add Working directory to prompt.
                        ::
                            [user@hostame]─[~/path/i/am/in]
                                             ^ add this
  --set_delim_color value
                        Set Delimiter color.
  --set_ends start end  Set Section start / end values.
                        ::
                            {}
                            {section1}-{section2}
                        
                            []
                            [section1]-[section2]
                        
                            ❰❱
                            ❰section1❱-❰section2❱
  --set_fancy_lines     Set fancy line breaks like the following
                        ::
                            ┌───
                            ├───
                            └──╼
  --set_no_color value  Set terminal to no color.
  --set_no_ps1_escape   For prompt debugging, set an option to not escape the unicode and non-printable chars.
  --set_prompt_color color
                        Set prompt color.
                        ::
                            i.e. $ or # depending on user
  --set_section_color color
                        Set default section color.
  --set_section_delim delim
                        Set section separator.
                        ::
                            i.e. [section1]-[section2]
                                           ^ separator
  --set_title_color value
                        Set title color.

Examples

usage: ps1 examples [-h]

optional arguments:
  -h, --help  show this help message and exit

Listcolors

usage: ps1 listcolors [-h] [--filter FILTER]

optional arguments:
  -h, --help            show this help message and exit
  --filter FILTER, -f FILTER
                        Filter color values

Template

usage: ps1 template [-h] [-t TEMPLATE_NAME] [-l]

optional arguments:
  -h, --help            show this help message and exit
  -t TEMPLATE_NAME, --template_name TEMPLATE_NAME
                        Template Name
  -l, --list            List Templates


GitHub - shollingsworth/ps1: PS1 Bash Prompt Builder
PS1 Bash Prompt Builder. Contribute to shollingsworth/ps1 development by creating an account on GitHub.