move the examples around

should probably all be consolidated in readme
This commit is contained in:
Jens Petersen 2023-11-11 18:01:09 +08:00
parent d50be4acd4
commit f2daf2ccc6

View File

@ -1,21 +1,25 @@
## to truncate \w dirpath set:
# PROMPT_DIRTRIM=4
# see also /usr/share/doc/bash-color-prompt/README.md
# example colorings:
# PROMPT_COLOR=0 # disable colors/attribs
# PROMPT_COLOR=1 # bold prompt
# PROMPT_COLOR=2 # dim prompt
# PROMPT_COLOR=4 # underline prompt
# PROMPT_COLOR='2;7' # dim reverse video
# PROMPT_COLOR='42' # green background
# PROMPT_COLOR='53' # overline separator
# PROMPT_COLOR='1;33;44' # bold yellow on blue
# PROMPT_COLOR='43;30' # black on yellow
# PROMPT_COLOR='1;32' # bold green
# PROMPT_COLOR='' # unset defaults to green
# See <https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters> for ANSI codes
## to truncate \w dirpath set:
# PROMPT_DIRTRIM=3
# only set for color terminals and if PS1 unchanged from bash or fedora defaults
if [ '(' "$PS1" = "[\u@\h \W]\\$ " -o "$PS1" = "\\s-\\v\\\$ " ')' -a "${TERM: -5}" = "color" -o -n "${prompt_color_force}" ]; then
# examples:
# PROMPT_COLOR=0 # disable colors/attribs
# PROMPT_COLOR=1 # bold prompt
# PROMPT_COLOR=2 # dim prompt
# PROMPT_COLOR=4 # underline prompt
# PROMPT_COLOR='2;7' # dim reverse video
# PROMPT_COLOR='42' # green background
# PROMPT_COLOR='53' # overline separator
# PROMPT_COLOR='1;33;44' # bold yellow on blue
# PROMPT_COLOR='1;32' # bold green
# PROMPT_COLOR='' # unset defaults to green
PS1='${PROMPT_BRACKETS:+[}\[\e[${PROMPT_COLOR:-32}m\]${container:+⬢ }\u@\h\[\e[0m\]:\[\e[${PROMPT_DIR_COLOR:-${PROMPT_COLOR:-32}}m\]\w${PROMPT_ERROR:+\[\e[0;31m\]${?#0}}\[\e[0m\]${PROMPT_BRACKETS:+]}\$ '