Skip to content

Commit 1c702ec

Browse files
committed
Introduce JOLLY_COLOR_HOSTNAME
It is now possible to configure colors of the hostname segment independently. Although it may seem contrary to the the spirit of the Jolly theme to limit distractions for the user, it may actually help users quickly distingush hosts they are working with. If not set in a configuration file JOLLY_COLOR_HOSTNAME is initialized with the value of JOLLY_COLOR_LITE.
1 parent 3aaf5fa commit 1c702ec

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,12 @@ The color for elements related to a warning.
473473
The color for elements that are not very important.
474474

475475

476-
**JOLLY_COLOR_PATH_SHORT** *array<int> = (252 239 0 0 0 15)*
476+
**JOLLY_COLOR_HOSTNAME** *array<int> = ( ${JOLLY_COLOR_LITE[@]} )*
477+
478+
The color for the hostname segment. By default initialized from JOLLY_COLOR_LITE.
479+
480+
481+
**JOLLY_COLOR_PATH_SHORT** *array<int> = (252 239 0 0 0 7)*
477482

478483
The color of the shorten path marker.
479484

jolly.theme

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ _lp_jolly_theme_activate() {
164164
JOLLY_COLOR_SEP_LITE=( ${JOLLY_COLOR_SEP_LITE[@]+"${JOLLY_COLOR_SEP_LITE[@]}"} )
165165
[[ ${#JOLLY_COLOR_SEP_LITE[@]} == 0 ]] && JOLLY_COLOR_SEP_LITE=( 15 -2 0 0 15 -2)
166166

167+
JOLLY_COLOR_HOSTNAME=( ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"} )
168+
[[ ${#JOLLY_COLOR_HOSTNAME[@]} == 0 ]] && JOLLY_COLOR_HOSTNAME=( ${JOLLY_COLOR_LITE[@]} )
169+
167170
# Default line color for unset variables.
168171
LP_COLOR_ENV_VARS_UNSET=${LP_COLOR_ENV_VARS_UNSET:-""}
169172
# Use the background of notes as a foreground for set variables.
@@ -197,7 +200,7 @@ _lp_jolly_theme_activate() {
197200

198201

199202
_lp_jolly_theme_directory() {
200-
lp_terminal_format ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
203+
lp_terminal_format ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
201204
__jolly_directory_FS
202205
__jolly_directory_path
203206
}
@@ -882,7 +885,7 @@ __jolly_activate_hostname() {
882885
hostname="${JOLLY_HOST_LOCAL}"
883886
fi
884887

885-
__jolly_make_field "$hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
888+
__jolly_make_field "$hostname" ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
886889
_JOLLY_HOSTNAME="${jolly_field}"
887890
}
888891

@@ -892,20 +895,20 @@ __jolly_activate_multiplexer() {
892895
if _lp_multiplexer ; then
893896
case "$lp_multiplexer" in
894897
tmux)
895-
__jolly_make_sep_link ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
898+
__jolly_make_sep_link ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
896899
multiplexer="${jolly_sep}"
897900
;;
898901
screen)
899-
__jolly_make_sep_link ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
902+
__jolly_make_sep_link ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
900903
multiplexer="${jolly_sep}"
901904
;;
902905
*)
903-
__jolly_make_sep_link ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
906+
__jolly_make_sep_link ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
904907
multiplexer="${jolly_sep}"
905908
;;
906909
esac
907910
else
908-
__jolly_make_sep_plug ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
911+
__jolly_make_sep_plug ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
909912
multiplexer="${jolly_sep}"
910913
fi
911914

0 commit comments

Comments
 (0)