File tree Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -39,25 +39,24 @@ geometry::time() {
39
39
40
40
# Generate a color based on hostname.
41
41
geometry::hostcolor () {
42
+ if (( ${+GEOMETRY_HOST_COLOR} )) ; then
43
+ echo ${GEOMETRY_HOST_COLOR}
44
+ return
45
+ fi
42
46
43
- if (( ${+GEOMETRY_HOST_COLOR} )) ; then
44
- echo ${GEOMETRY_HOST_COLOR}
45
- return
46
- fi
47
-
48
- if (( ${+GEOMETRY_HOST_COLORS} )) ; then
49
- local colors=(${GEOMETRY_HOST_COLORS} )
50
- else
51
- local colors=({1..9})
52
- (( $(echotc Co) == 256 )) && colors+=({17..230})
53
- fi
47
+ if (( ${+GEOMETRY_HOST_COLORS} )) ; then
48
+ local colors=(${GEOMETRY_HOST_COLORS} )
49
+ else
50
+ local colors=({1..9})
51
+ (( $(echotc Co) == 256 )) && colors+=({17..230})
52
+ fi
54
53
55
- local sum=0; for c in ${(s:: )^HOST} ; do (( sum += $(print - f '% d' "'$c ")) ); done
56
- local index=" $(( $sum % ${# colors} )) "
54
+ local sum=0; for c in ${(s:: )^HOST} ; do (( sum += $(print - f '% d' "'$c ")) ); done
55
+ local index=" $(( $sum % ${# colors} )) "
57
56
58
- [[ " $index " -eq 0 ]] && index = 1
57
+ [[ " $index " -eq 0 ]] && index = 1
59
58
60
- echo ${colors[${index}]}
59
+ echo ${colors[${index}]}
61
60
}
62
61
63
62
# set title to COMMAND @ CURRENT_DIRECTORY
You can’t perform that action at this time.
0 commit comments