X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/79d4a3561fa6b4bc80d75d8f9940139c2437df36..975ad64b1891b5653db9816fd95550896ae2a7a8:/base/.zsh/functions/Prompts/prompt_arrows_setup diff --git a/base/.zsh/functions/Prompts/prompt_arrows_setup b/base/.zsh/functions/Prompts/prompt_arrows_setup index 8719a12..b026822 100644 --- a/base/.zsh/functions/Prompts/prompt_arrows_setup +++ b/base/.zsh/functions/Prompts/prompt_arrows_setup @@ -25,7 +25,7 @@ function prompt_arrows_setup() { prompt_opts=( cr sp percent subst ) - # TODO: check for color terminal. never will use B&W term but still a XXX + # XXX: no checks for color terminal or if escapes work, except for echotc local m n p s r c d u #TODO remove n? m=${1:-2line} # Mode @@ -40,6 +40,8 @@ function prompt_arrows_setup() { # [AC]CURSED COMMAND # concatenate the numerical values of each letter of the hostname, # moduloing by the number of possible colors. + x=$(echotc Co) + [[ -z $x ]] && x=8 local generated=$(uname -n | od -An -td1 | awk -F' ' \ "{for (i=1; i<=NF; i++) {sum+=1; sum*=\$i; sum%=$(echotc Co)} print sum}") [[ $p = random ]] && p=$generated