diff --git a/bin/color_from_hostname.py b/bin/color_from_hostname.py index c040d94..dbbb203 100755 --- a/bin/color_from_hostname.py +++ b/bin/color_from_hostname.py @@ -2,11 +2,11 @@ import socket -hostname = socket.gethostname() +hostname = socket.gethostname().split('.')[0] s = 0 for c in hostname: - s = s + ord(c) + s = s + ord(c) color = str(1 + s % 14).rjust(3, '0') print '$FG[{}]'.format(color)