Skip to content

Instantly share code, notes, and snippets.

@jedahan
Created July 25, 2016 16:01
Show Gist options
  • Select an option

  • Save jedahan/99e5523e29f67ce8f65c757cdaa1f307 to your computer and use it in GitHub Desktop.

Select an option

Save jedahan/99e5523e29f67ce8f65c757cdaa1f307 to your computer and use it in GitHub Desktop.
diff --git a/geometry.zsh b/geometry.zsh
index a857d4a..5ef1374 100644
--- a/geometry.zsh
+++ b/geometry.zsh
@@ -117,8 +117,13 @@ prompt_geometry_set_title() {
}
prompt_geometry_render() {
+ sum=0 # dumb hashing function
+ for i in ${#HOST}; do
+ ord=$(printf '%d' "'$HOST[$i]")
+ sum=$(($sum + ${i+1} * $ord))
+ done
PROMPT="
- %(?.$PROMPT_SYMBOL.$EXIT_VALUE_SYMBOL) %{$fg[blue]%}%3~%{$reset_color%} "
+ %(?.%F{$(($sum % 8))}$PROMPT_SYMBOL.$EXIT_VALUE_SYMBOL) %F{blue}%3~%{$reset_color%} "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment