feat(host): color the middle line with the host hash
If LP_ENABLE_SSH_COLORS, the the middle line will be colored with the host hash.
This commit is contained in:
parent
45fda6cd5a
commit
c5eef33dad
1 changed files with 14 additions and 7 deletions
|
|
@ -493,18 +493,25 @@ _lp_dotmatrix_theme_prompt() {
|
||||||
####################################################################
|
####################################################################
|
||||||
# IN LINE
|
# IN LINE
|
||||||
####################################################################
|
####################################################################
|
||||||
|
local color_line
|
||||||
lp_terminal_format ${DOTMATRIX_COLOR_LINE[@]+"${DOTMATRIX_COLOR_LINE[@]}"}
|
if (( LP_ENABLE_SSH_COLORS )); then
|
||||||
|
local lp_hostname_hash
|
||||||
local inline_left="${NO_COL}$LP_PS1_PREFIX${lp_terminal_format}${DOTMATRIX_LINE}"
|
__lp_hostname_hash
|
||||||
|
__lp_foreground_color "$(( 1 + lp_hostname_hash % 6 ))"
|
||||||
|
color_line="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}"
|
||||||
|
else
|
||||||
|
lp_terminal_format ${DOTMATRIX_COLOR_LINE[@]+"${DOTMATRIX_COLOR_LINE[@]}"}
|
||||||
|
color_line="$lp_terminal_format"
|
||||||
|
fi
|
||||||
|
local inline_left="${NO_COL}$LP_PS1_PREFIX${color_line}${DOTMATRIX_LINE}"
|
||||||
|
|
||||||
# Dev env section.
|
# Dev env section.
|
||||||
local ista="$_LP_FIRST_INDEX"
|
local ista="$_LP_FIRST_INDEX"
|
||||||
local imid=$((_LP_FIRST_INDEX+1))
|
local imid=$((_LP_FIRST_INDEX+1))
|
||||||
local iend=$((_LP_FIRST_INDEX+2))
|
local iend=$((_LP_FIRST_INDEX+2))
|
||||||
local d="${DOTMATRIX_ITEMS[ista]}${DOTMATRIX_SPACE_LINE}"
|
local d="${DOTMATRIX_ITEMS[ista]}${DOTMATRIX_SPACE_LINE}${NO_COL}"
|
||||||
local I="${DOTMATRIX_SPACE_LINE}${DOTMATRIX_ITEMS[imid]}${DOTMATRIX_SPACE_LINE}"
|
local I="${color_line}${DOTMATRIX_SPACE_LINE}${DOTMATRIX_ITEMS[imid]}${DOTMATRIX_SPACE_LINE}${NO_COL}"
|
||||||
local b="${DOTMATRIX_SPACE_LINE}${DOTMATRIX_ITEMS[iend]}"
|
local b="${color_line}${DOTMATRIX_SPACE_LINE}${DOTMATRIX_ITEMS[iend]}"
|
||||||
if _lp_software_collections ; then
|
if _lp_software_collections ; then
|
||||||
inline_left+="$d${lp_software_collections}$b"
|
inline_left+="$d${lp_software_collections}$b"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue