#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG 6.7				#
#							#
# Licensed under GNU LESSER GENERAL PUBLIC LICENSE v3	#
#							#
# Copyright 2007 - 2008 Christopher Bratusek		#
#							#
#########################################################

if [[ $TERM != *xterm* ]]; then 
	export enabcol=false
else	export enabcol=$(gconftool-2 --get /apps/bashstyle/use_colors)
fi

if [[ $enabcol == true ]]; then

export colstyle=$(gconftool-2 --get /apps/bashstyle/color_style)

if [[ $colstyle == bright ]]; then \

export black="\[\033[01;38;5;0m\]"
export red="\[\033[01;38;5;1m\]"
export green="\[\033[01;38;5;2m\]"
export yellow="\[\033[01;38;5;3m\]"
export blue="\[\033[01;38;5;4m\]"
export magenta="\[\033[01;38;5;129m\]"
export cyan="\[\033[01;38;5;6m\]"
export white="\[\033[01;38;5;7m\]"
export coldblue="\[\033[01;38;5;33m\]"
export smoothblue="\[\033[01;38;5;111m\]"
export iceblue="\[\033[01;38;5;45m\]"
export turqoise="\[\033[01;38;5;50m\]"
export smoothgreen="\[\033[01;38;5;42m\]"

elif [[ $colstyle == normal ]]; then \

export black="\[\033[0;38;5;0m\]"
export red="\[\033[0;38;5;1m\]"
export green="\[\033[0;38;5;2m\]"
export yellow="\[\033[0;38;5;3m\]"
export blue="\[\033[0;38;5;4m\]"
export magenta="\[\033[0;38;5;55m\]"
export cyan="\[\033[0;38;5;6m\]"
export white="\[\033[0;38;5;7m\]"
export coldblue="\[\033[0;38;5;33m\]"
export smoothblue="\[\033[0;38;5;111m\]"
export iceblue="\[\033[0;38;5;45m\]"
export turqoise="\[\033[0;38;5;50m\]"
export smoothgreen="\[\033[0;38;5;42m\]"

elif [[ $colstyle == inverted ]]; then \

export black="\[\033[7;38;5;0m\]"
export red="\[\033[7;38;5;1m\]"
export green="\[\033[7;38;5;2m\]"
export yellow="\[\033[7;38;5;3m\]"
export blue="\[\033[7;38;5;4m\]"
export magenta="\[\033[7;38;5;55m\]"
export cyan="\[\033[7;38;5;6m\]"
export white="\[\033[7;38;5;7m\]"
export coldblue="\[\033[7;38;5;33m\]"
export smoothblue="\[\033[7;38;5;111m\]"
export iceblue="\[\033[7;38;5;45m\]"
export turqoise="\[\033[7;38;5;50m\]"
export smoothgreen="\[\033[7;38;5;42m\]"

elif [[ $colstyle == dimmed ]]; then \

export black="\[\033[02;38;5;0m\]"
export red="\[\033[02;38;5;1m\]"
export green="\[\033[02;38;5;2m\]"
export yellow="\[\033[02;38;5;3m\]"
export blue="\[\033[02;38;5;4m\]"
export magenta="\[\033[02;38;5;55m\]"
export cyan="\[\033[02;38;5;6m\]"
export white="\[\033[02;38;5;7m\]"
export coldblue="\[\033[02;38;5;33m\]"
export smoothblue="\[\033[02;38;5;111m\]"
export iceblue="\[\033[02;38;5;45m\]"
export turqoise="\[\033[02;38;5;50m\]"
export smoothgreen="\[\033[02;38;5;42m\]"

elif [[ $colstyle == underlined ]]; then \

export black="\[\033[04;38;5;0m\]"
export red="\[\033[04;38;5;1m\]"
export green="\[\033[04;38;5;2m\]"
export yellow="\[\033[04;38;5;3m\]"
export blue="\[\033[04;38;5;4m\]"
export magenta="\[\033[04;38;5;55m\]"
export cyan="\[\033[04;38;5;6m\]"
export white="\[\033[04;38;5;7m\]"
export coldblue="\[\033[04;38;5;33m\]"
export smoothblue="\[\033[04;38;5;111m\]"
export iceblue="\[\033[04;38;5;45m\]"
export turqoise="\[\033[04;38;5;50m\]"
export smoothgreen="\[\033[04;38;5;42m\]"

fi

echo -E ucolor="$(gconftool-2 --get /apps/bashstyle/user_color)" > ~/.color-rc
echo -E hcolor="$(gconftool-2 --get /apps/bashstyle/host_color)" >> ~/.color-rc
echo -E dcolor="$(gconftool-2 --get /apps/bashstyle/date_color)" >> ~/.color-rc
echo -E tcolor="$(gconftool-2 --get /apps/bashstyle/time_color)" >> ~/.color-rc
echo -E wcolor="$(gconftool-2 --get /apps/bashstyle/wdir_color)" >> ~/.color-rc
echo -E fcolor="$(gconftool-2 --get /apps/bashstyle/font_color)" >> ~/.color-rc
echo -E scolor="$(gconftool-2 --get /apps/bashstyle/sepa_color)" >> ~/.color-rc
echo -E uptcolor="$(gconftool-2 --get /apps/bashstyle/uptime_color)" >> ~/.color-rc
echo -E pcol="$(gconftool-2 --get /apps/bashstyle/ps234_color)" >> ~/.color-rc

source ~/.color-rc

export usercolor=$ucolor
export hostcolor=$hcolor
export datecolor=$dcolor
export timecolor=$tcolor
export wdircolor=$wcolor
export fontcolor=$fcolor
export sepacolor=$scolor
export upcolor=$uptcolor
export pscol=$pcol

fi
