2016-08-01 15:24:20 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2017-12-14 10:18:00 +00:00
|
|
|
from __future__ import print_function
|
|
|
|
|
2016-08-01 15:24:20 +00:00
|
|
|
import socket
|
|
|
|
|
2017-07-20 06:56:55 +00:00
|
|
|
hostname = socket.gethostname().split('.')[0]
|
2016-08-01 15:24:20 +00:00
|
|
|
|
|
|
|
s = 0
|
|
|
|
for c in hostname:
|
2017-07-20 06:56:55 +00:00
|
|
|
s = s + ord(c)
|
2016-08-01 15:24:20 +00:00
|
|
|
|
|
|
|
color = str(1 + s % 14).rjust(3, '0')
|
2017-12-14 10:18:00 +00:00
|
|
|
print('$FG[{}]'.format(color))
|