Skip to content

Commit 52dad2c

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 a3de748 commit 52dad2c

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

README.md

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

473473

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

476481
The color of the shorten path marker.
477482

jolly.theme

Lines changed: 10 additions & 7 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
}
@@ -880,10 +883,10 @@ __jolly_activate_hostname() {
880883
hostname="${JOLLY_HOST_LOCAL}"
881884
fi
882885

883-
if __jolly_make_field "$hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"} ; then
886+
if __jolly_make_field "$hostname" ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"} ; then
884887
_JOLLY_HOSTNAME="${jolly_field}"
885888
else
886-
if __jolly_make_field "$lp_hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"} ; then
889+
if __jolly_make_field "$lp_hostname" ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"} ; then
887890
_JOLLY_HOSTNAME="${jolly_field}"
888891
else
889892
_JOLLY_HOSTNAME="${lp_hostname}"
@@ -897,20 +900,20 @@ __jolly_activate_multiplexer() {
897900
if _lp_multiplexer ; then
898901
case "$lp_multiplexer" in
899902
tmux)
900-
__jolly_make_sep_link ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
903+
__jolly_make_sep_link ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
901904
multiplexer="${jolly_sep}"
902905
;;
903906
screen)
904-
__jolly_make_sep_link ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
907+
__jolly_make_sep_link ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
905908
multiplexer="${jolly_sep}"
906909
;;
907910
*)
908-
__jolly_make_sep_link ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
911+
__jolly_make_sep_link ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
909912
multiplexer="${jolly_sep}"
910913
;;
911914
esac
912915
else
913-
__jolly_make_sep_plug ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
916+
__jolly_make_sep_plug ${JOLLY_COLOR_HOSTNAME[@]+"${JOLLY_COLOR_HOSTNAME[@]}"}
914917
multiplexer="${jolly_sep}"
915918
fi
916919

0 commit comments

Comments
 (0)