zsh: change context color to md5sum hash method

This commit is contained in:
2023-07-12 06:28:37 -04:00
parent 0128eccf4f
commit c7e870a90a

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 | sum | cut -d' ' -f1) hash=$(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