#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG 7.6				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2009 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 style="01"
elif [[ $colstyle == normal ]]; then \
	export style="0"
elif [[ $colstyle == inverted ]]; then \
	export style="7"
elif [[ $colstyle == dimmed ]]; then \
	export style="02"
elif [[ $colstyle == underlined ]]; then \
	export style="04"
fi

export black="\[\033[${style};38;5;0m\]"
export red="\[\033[${style};38;5;1m\]"
export green="\[\033[${style};38;5;2m\]"
export yellow="\[\033[${style};38;5;3m\]"
export blue="\[\033[${style};38;5;4m\]"
export magenta="\[\033[${style};38;5;129m\]"
export cyan="\[\033[${style};38;5;6m\]"
export white="\[\033[${style};38;5;7m\]"
export coldblue="\[\033[${style};38;5;33m\]"
export smoothblue="\[\033[${style};38;5;111m\]"
export iceblue="\[\033[${style};38;5;45m\]"
export turqoise="\[\033[${style};38;5;50m\]"
export smoothgreen="\[\033[${style};38;5;42m\]"
export winered="\[\033[${style};38;5;637m\]"
export brown="\[\033[${style};38;5;684m\]"
export silver="\[\033[${style};38;5;761m\]"
export ocher="\[\033[${style};38;5;690m\]"
export orange="\[\033[${style};38;5;714m\]"
export purple="\[\033[${style};38;5;604m\]"
export pink="\[\033[${style};38;5;213m\]"
export cream="\[\033[${style};38;5;5344m\]"

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 pscolor=$pcol

fi
