From c7e870a90a1266f3d9f016221db8038caef2889a Mon Sep 17 00:00:00 2001 From: Kitty Cat Date: Wed, 12 Jul 2023 06:28:37 -0400 Subject: [PATCH] zsh: change context color to md5sum hash method --- zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/zshrc b/zsh/zshrc index 2f00306..8a2160c 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -71,7 +71,7 @@ function dotfiles-update() { function context-color() { 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" id=$(( $hash % $hexcount )) for excid in $(echo "$excludes" | tr "," '\n'); do