diff --git a/functions/geometry_status.zsh b/functions/geometry_status.zsh index e551faf1..73ab630f 100644 --- a/functions/geometry_status.zsh +++ b/functions/geometry_status.zsh @@ -13,9 +13,17 @@ geometry_status() { (($(echotc Co) == 256)) && colors+=({17..230}) + if (( ${+GEOMETRY_STATUS_SYMBOL_COLOR_HASH_COLORS} )); then + colors=(${GEOMETRY_STATUS_SYMBOL_COLOR_HASH_COLORS}) + fi + local sum=0; for c in ${(s::)^HOST}; do ((sum += $(print -f '%d' "'$c"))); done - GEOMETRY_STATUS_COLOR=${colors[$(($sum % ${#colors}))]} + local index=$(($sum % ${#colors})) + + [[ "$index" -eq 0 ]] && index=1 + + GEOMETRY_STATUS_COLOR=${colors[${index}]} } local color=GEOMETRY_STATUS_COLOR symbol=GEOMETRY_STATUS_SYMBOL