zsh: fix context hashing

This commit is contained in:
2023-07-12 06:41:12 -04:00
parent c7e870a90a
commit d0aff9df46

View File

@@ -71,7 +71,7 @@ function dotfiles-update() {
function context-color() { function context-color() {
hexcount=$(($(infocmp -1 | sed -n -e 's/^\t*colors#\([0-9]x\?[0-9]*\),.*/\1/p')-1)) hexcount=$(($(infocmp -1 | sed -n -e 's/^\t*colors#\([0-9]x\?[0-9]*\),.*/\1/p')-1))
hash=$(hostname | md5sum | head -c 6 | tr '[:lower:]' '[:upper:]') hash=$(printf "%d\n" "0x$(hostname | md5sum | head -c 6 | tr '[:lower:]' '[:upper:]')")
excludes="0,7,15" excludes="0,7,15"
id=$(( $hash % $hexcount )) id=$(( $hash % $hexcount ))
for excid in $(echo "$excludes" | tr "," '\n'); do for excid in $(echo "$excludes" | tr "," '\n'); do