diff --git a/.zsh/oh-my-custom/luzifer.zsh-theme b/.zsh/oh-my-custom/luzifer.zsh-theme index bbced78..c03cdcb 100644 --- a/.zsh/oh-my-custom/luzifer.zsh-theme +++ b/.zsh/oh-my-custom/luzifer.zsh-theme @@ -17,7 +17,7 @@ function prompt_char { } function box_color { - [ -f ~/.box_color ] && cat ~/.box_color || echo '$FG[033]' + [ -f ~/.box_color ] && cat ~/.box_color || ~/bin/color_from_hostname.py } function box_name { diff --git a/bin/color_from_hostname.py b/bin/color_from_hostname.py new file mode 100755 index 0000000..c040d94 --- /dev/null +++ b/bin/color_from_hostname.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import socket + +hostname = socket.gethostname() + +s = 0 +for c in hostname: + s = s + ord(c) + +color = str(1 + s % 14).rjust(3, '0') +print '$FG[{}]'.format(color)