1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-21 19:52:29 +00:00

Added 256 color code for hostname PS1

This commit is contained in:
J. Fernando Sánchez 2016-12-22 10:18:04 +01:00
parent 2f78d852e6
commit 2d20791d0d

View File

@ -21,7 +21,12 @@ _prompt_balkian_current_bg='NONE'
_prompt_balkian_segment_separator=' ' _prompt_balkian_segment_separator=' '
_prompt_balkian_start_time=$SECONDS _prompt_balkian_start_time=$SECONDS
hostnamecolor=$(hostname | od | tr ' ' '\n' | awk '{total = total + $1}END{print 30 + (total % 6)}') #hostnamecolor=$(hostname | od | tr ' ' '\n' | awk '{total = total + $1}END{print 30 + (total % 6)}')
if [[ $TERM =~ "256color" ]]; then
hostnamecolor="$((16 + $(hostname | cksum | cut -c1-3) % 256))";
else
hostnamecolor="$((31 + $(hostname | cksum | cut -c1-3) % 6))";
fi
function prompt_balkian_start_segment { function prompt_balkian_start_segment {
local bg fg local bg fg