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

if [[ $(gconftool-2 --get /apps/bashstyle/use_bashstyle) == False ]]; then exit; fi

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

if [[ $(gconftool-2 --get /apps/bashstyle/readline/use_rlconfig) == true ]]; then
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/bellstyle) == audible ]]; then
		echo "set bell-style audible" > $HOME/.inputrc
	elif [[ $(gconftool-2 --get /apps/bashstyle/readline/bellstyle) == visible ]]; then
		echo "set bell-style visible" > $HOME/.inputrc
	elif [[ $(gconftool-2 --get /apps/bashstyle/readline/bellstyle) == none ]]; then
		echo "set bell-style none" > $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/enable_completion) == true ]]; then
		echo "set disable-completion Off" >> $HOME/.inputrc
	else 	echo "set disable-completion On" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/scroll_h) == true ]]; then
		echo "set horizontal-scroll-mode On" >> $HOME/.inputrc
	else	echo "set horizontal-scroll-mode Off" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/ambiguous) == true ]]; then
		echo "set show-all-if-ambiguous On" >> $HOME/.inputrc
	else	echo "set show-all-if-ambiguous Off" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/hidden) == true ]]; then
		echo "set match-hidden-files On" >> $HOME/.inputrc
	else	echo "set match-hidden-files Off" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/ignorecase) == true ]]; then
		echo "set completition-ignore-case On" >> $HOME/.inputrc
	else	echo "set completition-ignore-case Off" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/editing_mode) == emacs ]]; then
		echo "set editing-mode emacs" >> $HOME/.inputrc
	else	echo "set editing-mode vi" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/vstats) == true ]]; then
		echo "set visible-stats On" >> $HOME/.inputrc
	else	echo "set visible-stats Off" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/comp_h) == true ]]; then
		echo "set print-completions-horizontally On" >> $HOME/.inputrc
	else	echo "set print-completions-horizontally Off" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/mark_dirs) == true ]]; then
		echo "set mark-directories On" >> $HOME/.inputrc
	else	echo "set mark-directories Off" >> $HOME/.inputrc
	fi
	if [[ $(gconftool-2 --get /apps/bashstyle/readline/mark_sym_dirs) == true ]]; then
		echo "set mark-symlinked-directories On" >> $HOME/.inputrc
	else	echo "set mark-symlinked-directories Off" >> $HOME/.inputrc
	fi
	echo -E '"\e[5~": menu-complete' >> $HOME/.inputrc
	echo -E '"\e[6~": menu-complete' >> $HOME/.inputrc
fi

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

export enabup=$(gconftool-2 --get /apps/bashstyle/show_uptime)

export enabsize=$(gconftool-2 --get /apps/bashstyle/show_size_of_files)

export enablf=$(gconftool-2 --get /apps/bashstyle/show_files_amount)

export enabtty=$(gconftool-2 --get /apps/bashstyle/show_tty)

export enabcol=$(gconftool-2 --get /apps/bashstyle/use_colors)

if [[ $TERM != *xterm* ]]; then export enabcol=false; fi

export sepa=$(gconftool-2 --get /apps/bashstyle/char_separator)

if [[ $(gconftool-2 --get /apps/bashstyle/random) == true ]]; then \
	number=$(( 1+(`od -An -N2 -i /dev/random` )%(13) ))
	if [[ $number == 1 ]]; then
		export pstyle=separator
	elif [[ $number == 2 ]]; then
		export pstyle=vector
	elif [[ $number == 3 ]]; then
		export pstyle=clock
	elif [[ $number == 4 ]]; then
		export pstyle=clock-ad
	elif [[ $number == 5 ]]; then
		export pstyle=dash
	elif [[ $number == 6 ]]; then
		export pstyle=job
	elif [[ $number == 7 ]]; then
		export pstyle=elite
	elif [[ $number == 8 ]]; then
		export pstyle=poweruser
	elif [[ $number == 9 ]]; then
		export pstyle=dirks
	elif [[ $number == 10 ]]; then
		export pstyle=minimal
	elif [[ $number == 11 ]]; then
		export pstyle=dot_prompt
	elif [[ $number == 12 ]]; then
		export pstyle=bracket
	elif [[ $number == 13 ]]; then
		export pstyle=sepa_ng
	fi
else export pstyle=$(gconftool-2 --get /apps/bashstyle/prompt_style)
fi

ps234char=$(gconftool-2 --get /apps/bashstyle/char_ps234)

if [[ $(gconftool-2 --get /apps/bashstyle/colored_ls) == true ]]; then \
	alias ls="ls --color=auto"
fi

if [[ $(gconftool-2 --get /apps/bashstyle/colored_man) == true ]]; then \
	if   [[ $(gconftool-2 --get /apps/bashstyle/man_style) == mostlike ]]; then \
		alias man="TERMINFO=/usr/share/bashstyle-ng/terminfo TERM=mostlike LESS=C PAGER=less man"
	elif [[ $(gconftool-2 --get /apps/bashstyle/man_style) == mostlike-bold ]]; then \
		alias man="TERMINFO=/usr/share/bashstyle-ng/terminfo TERM=mostlikebold LESS=C PAGER=less man"
	fi
fi

if [[ $(gconftool-2 --get /apps/bashstyle/alias1) != "" ]]; then \
	alias "$(gconftool-2 --get /apps/bashstyle/alias1)"
fi

if [[ $(gconftool-2 --get /apps/bashstyle/alias2) != "" ]]; then \
	alias "$(gconftool-2 --get /apps/bashstyle/alias2)"
fi

if [[ $(gconftool-2 --get /apps/bashstyle/alias3) != "" ]]; then \
	alias "$(gconftool-2 --get /apps/bashstyle/alias3)"
fi

if [[ $(gconftool-2 --get /apps/bashstyle/alias4) != "" ]]; then \
	alias "$(gconftool-2 --get /apps/bashstyle/alias4)"
fi

if [[ $(gconftool-2 --get /apps/bashstyle/alias5) != "" ]]; then \
	alias "$(gconftool-2 --get /apps/bashstyle/alias5)"
fi

if [[ $(gconftool-2 --get /apps/bashstyle/alias6) != "" ]]; then \
	alias "$(gconftool-2 --get /apps/bashstyle/alias6)"
fi

if [[ $(gconftool-2 --get /apps/bashstyle/alias7) != "" ]]; then \
	alias "$(gconftool-2 --get /apps/bashstyle/alias7)"
fi

export HISTCONTROL=$(gconftool-2 --get /apps/bashstyle/hist_control)

export HISTIGNORE=$(gconftool-2 --get /apps/bashstyle/hist_ignore)

export FIGNORE=$(gconftool-2 --get /apps/bashstyle/fignore)

export CDPATH=$(gconftool-2 --get /apps/bashstyle/cdpath)

export FCEDIT=$(gconftool-2 --get /apps/bashstyle/fcedit)

export TMOUT=$(gconftool-2 --get /apps/bashstyle/tmout)

if [[ $(gconftool-2 --get /apps/bashstyle/use_grep_color) == true ]]; then \
	export GREP_OPTIONS="--color=auto";
	export GREP_COLOR=$(gconftool-2 --get /apps/bashstyle/grep_color);
fi

if [[ $HISTCONTROL != erasedups && $(gconftool-2 --get /apps/bashstyle/shopt/histappend) ]]; then
	shopt -s histappend
fi

export HISTSIZE=$(gconftool-2 --get /apps/bashstyle/hist_size)

export HISTFILESIZE=$(gconftool-2 --get /apps/bashstyle/hist_size)

export PATH=$(gconftool-2 --get /apps/bashstyle/path)

if [[ $(gconftool-2 --get /apps/bashstyle/shopt/cdspell) == true ]]; then \
	shopt -s cdspell
fi

if [[ $(gconftool-2 --get /apps/bashstyle/shopt/cdable_vars) == true ]]; then \
	shopt -s cdable_vars
fi

if [[ $(gconftool-2 --get /apps/bashstyle/shopt/checkhash) == true ]]; then \
	shopt -s checkhash
fi

if [[ $(gconftool-2 --get /apps/bashstyle/shopt/cmdhist) == true ]]; then \
	shopt -s cmdhist
fi

if [[ $(gconftool-2 --get /apps/bashstyle/shopt/force_fignore) == true 
]]; then \
	shopt -s force_fignore
fi

if [[ $(gconftool-2 --get /apps/bashstyle/shopt/histreedit) == true ]]; then \
	shopt -s histreedit
fi

if [[ $(gconftool-2 --get /apps/bashstyle/shopt/no_empty_cmd_completion) == true ]]; then \
	shopt -s no_empty_cmd_completion
fi

shopt -s checkwinsize

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

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

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

if [[ $use_custom_prompt == true && $custom_prompt != "" && $custom_prompt != "Not Supported" ]]; then
	if [[ $custom_command != "" && $custom_command != "Not Supported" ]]; then
		echo -e "function pre_prompt { \n $custom_command \n } \n" > $HOME/.custom_prompt
		echo -e "PROMPT_COMMAND=pre_prompt \n" >> $HOME/.custom_prompt
		echo -E PS1=\"$custom_prompt\" >> $HOME/.custom_prompt
	else
		echo -E PS1=\"$custom_prompt\" > $HOME/.custom_prompt
	fi
	source $HOME/.custom_prompt
else

if [[ $enabcol == true && $pstyle == separator ]]; then \

	PS1="\n$usercolor\u$sepacolor $sepa$fontcolor @$hostcolor \h$sepacolor $sepa $datecolor\d$sepacolor $sepa $timecolor\t$sepacolor $sepa $wdircolor\$(truncpwd)"

	if [[ $enablf == true ]]; then
		PS1+=" files: \$(fdnl)"
	fi

	if [[ $enablf == true && $enabsize == true ]]; then
		PS1+=" /"
	fi

	if [[ $enabsize == true ]]; then
		PS1+=" size: \$(showsize)"
	fi

	if [[ $enabtty == true ]]; then
		PS1+=" $sepacolor$sepa$hostcolor tty: \$(showtty)"
	fi

	if [[ $enabup == true ]]; then
		PS1+=" $sepacolor$sepa$upcolor uptime: \$(showuptime)"
	fi

	PS1+="$sepacolor $sepa\n$usercolor$ $fontcolor-> "

elif [[ $enabcol == false && $pstyle == separator ]]; then

	PS1="\n\u $sepa @ \h $sepa \d $sepa \t $sepa \$(truncpwd)"

	if [[ $enablf == true ]]; then
		PS1+=" files: \$(fdnl)"
	fi

	if [[ $enablf == true && $enabsize == true ]]; then
		PS1+=" /"
	fi

	if [[ $enabsize == true ]]; then
		PS1+=" size: \$(showsize)"
	fi

	if [[ $enabtty == true ]]; then
		PS1+=" $sepa tty: \$(showtty)"
	fi

	if [[ $enabup == true ]]; then
		PS1+=" $sepa uptime: \$(showuptime)"
	fi

	PS1+=" $sepa\n$ -> "

elif [[ $enabcol == true && $pstyle == vector ]]; then

PS1="\n$pscol┌$sepacolor($usercolor \u$sepacolor @ $hostcolor\h \
$sepacolor)$pscol─$sepacolor( $datecolor\$(date +%I:%M%P)\
$pscol -:- $datecolor\$(date +%m)/\$(date +%d)$sepacolor )\n\
$pscol└$sepacolor( $wdircolor\$(truncpwd) $sepacolor)$pscol·>$fontcolor "

elif [[ $enabcol == false && $pstyle == vector ]]; then

PS1="\n┌( \u @ \h )─( \$(date +%I:%M%P)\
 -:- \$(date +%m)/\$(date +%d) )\
\n└( \$(truncpwd) )·> "

elif [[ $enabcol == true && $pstyle == clock ]]; then

function pre_prompt {

let prompt_x=$(tput cols)-13
tput sc
tput cup 0 ${prompt_x}
echo -en $(echo $sepacolor | sed -e 's/\\\[//g' -e 's/\\\]//g') "["
echo -en $(echo $datecolor | sed -e 's/\\\[//g' -e 's/\\\]//g') "$(date +%T)"
echo -en $(echo $sepacolor | sed -e 's/\\\[//g' -e 's/\\\]//g') "]"
tput rc
}

export PROMPT_COMMAND=pre_prompt

PS1="$sepacolor[$usercolor \u $fontcolor@ $hostcolor\h $pscol: $wdircolor\$(truncpwd)$sepacolor ]$fontcolor "

elif [[ $enabcol == false && $pstyle == clock ]]; then

function pre_prompt {

let prompt_x=$(tput cols)-10
tput sc
tput cup 0 ${prompt_x}
echo -n "["
echo -n " $(date +%T) "
echo -n "]"
tput rc
}

export PROMPT_COMMAND=pre_prompt

PS1="[ \u @ \h : \$(truncpwd) ] "

elif [[ $enabcol == true && $pstyle == clock-ad ]]; then

function pre_prompt {

newPWD="${PWD}"
user="whoami"
host=$(echo -n $HOSTNAME | sed -e "s/[\.].*//")
let promptsize=$(echo -n "--($user @ $host)---(${PWD})-------" \
                 | wc -c | tr -d " ")
let fillsize=${COLUMNS}-${promptsize}
fill=""
while [ "$fillsize" -gt "0" ]
do
    fill="${fill}—"
	let fillsize=${fillsize}-1
done
if [ "$fillsize" -lt "0" ]
then
    let cutt=3-${fillsize}
    newPWD="...$(echo -n $PWD | sed -e "s/\(^.\{$cutt\}\)\(.*\)/\2/")"
fi

export -E epscol=$(echo $pscol | sed -e 's/\\\[//g' -e 's/\\\]//g')
export -E edatecolor=$(echo $datecolor | sed -e 's/\\\[//g' -e 's/\\\]//g')

echo -en "\033[2;$((${COLUMNS}-13))H"
echo -en "$epscol($edatecolor $(date +%H:%M)$epscol )————┐"
export i=${LINES}
echo -en "\033[2;${COLUMNS}H"

while [ $i -ge 4 ]
do
   echo -en "\033[$(($i-1));${COLUMNS}H│"
   let i=$i-1
done

let prompt_line=${LINES}-1
}

PROMPT_COMMAND=pre_prompt

PS1="\[\033[\${prompt_line};0H\]\n\
$pscolor┌─( $usercolor\u $fontcolor@ $hostcolor\h \
$sepacolor)─\${fill}─( $wdircolor\${newPWD}\
$pscol )────┘\n\
$pscol└─( $datecolor\$(date \"+%a, %d %b %y\")\
$fontcolor : \$$sepacolor )·>$fontcolor "

elif [[ $enabcol == false && $pstyle == clock-ad ]]; then

function pre_prompt {

newPWD="${PWD}"
user="whoami"
host=$(echo -n $HOSTNAME | sed -e "s/[\.].*//")
let promptsize=$(echo -n "--($user @ $host)---(${PWD})-------" \
                 | wc -c | tr -d " ")
let fillsize=${COLUMNS}-${promptsize}
fill=""
while [ "$fillsize" -gt "0" ]
do
    fill="${fill}—"
	let fillsize=${fillsize}-1
done
if [ "$fillsize" -lt "0" ]
then
    let cutt=3-${fillsize}
    newPWD="...$(echo -n $PWD | sed -e "s/\(^.\{$cutt\}\)\(.*\)/\2/")"
fi

echo -en "\033[2;$((${COLUMNS}-13))H"
echo -en "( $(date +%H:%M) )————┐"
export i=${LINES}
echo -en "\033[2;${COLUMNS}H"

while [ $i -ge 4 ]
do
   echo -en "\033[$(($i-1));${COLUMNS}H│"
   let i=$i-1
done

let prompt_line=${LINES}-1
}

PROMPT_COMMAND=pre_prompt

PS1="\[\033[\${prompt_line};0H\]\n\
┌─( \u @ \h )─\${fill}─( \${newPWD}\
 )────┘\n└─( \$(date \"+%a, %d %b %y\") : $ )·> "

elif [[ $enabcol == true && $pstyle == dash ]]; then

PS1="\n\[\033[37;41;1m\]\u @ \h \[\033[37;40;1m\] $datecolor\d $timecolor\$(date +%I:%M:%S%P)\n$wdircolor\$(truncpwd)$fontcolor $ "

elif [[ $enabcol == false && $pstyle == dash ]]; then

PS1="\n\u @ \h \d \$(date +%I:%M:%S%P)\n\$(truncpwd) $ "

elif [[ $pstyle == poweruser ]]; then

function prompt_command
{

local one=$(uptime | sed -e "s/.*load average: \(.*\...\), \(.*\...\), \(.*\...\)/\1/" -e "s/ //g")
local five=$(uptime | sed -e "s/.*load average: \(.*\...\), \(.*\...\), \(.*\...\).*/\2/" -e "s/ //g")
local diff1_5=$(echo -e "scale = scale ($one) \nx=$one - $five\n if (x>0) {print \"up\"} else {print \"down\"}\n print x \nquit \n" | bc)
loaddiff="$(echo -n "${one}${diff1_5}" | sed -e 's/down\-/down/g')"

let files=$(ls -l | grep "^-" | wc -l | tr -d " ")
let hiddenfiles=$(ls -l -d .* | grep "^-" | wc -l | tr -d " ")
let executables=$(ls -l | grep ^-..x | wc -l | tr -d " ")
let directories=$(ls -l | grep "^d" | wc -l | tr -d " ")
let hiddendirectories=$(ls -l -d .* | grep "^d" | wc -l | tr -d " ")-2
let linktemp=$(ls -l | grep "^l" | wc -l | tr -d " ")
if [ "$linktemp" -eq "0" ]
then
    links=""
else
    links=" ${linktemp}l"
fi
unset linktemp
let devicetemp=$(ls -l | grep "^[bc]" | wc -l | tr -d " ")
if [ "$devicetemp" -eq "0" ]
then
    devices=""
else
    devices=" ${devicetemp}bc"
fi
unset devicetemp

}

PROMPT_COMMAND=prompt_command

if [[ $enabcol == false ]]; then
PS1="\n\
[ \$(date +%T) - \$(date +%D) ]\
[ \u @ \h ]\
[ \${files}.\${hiddenfiles}-\${executables}x \$(showsize) \
\${directories}.\${hiddendirectories}d\${links}\${devices}\
][ \${loaddiff} ][ \
\$(ps ax | wc -l | sed -e \"s: ::g\")proc ]\
\n[ \$(truncpwd) ] $ "
else PS1="\n\
$sepacolor[ $timecolor\$(date +%T) $fontcolor-$datecolor \$(date +%D) $sepacolor]\
$sepacolor[ $usercolor\u $fontcolor@ $hostcolor\h $sepacolor]\
$sepacolor[ $wdircolor\${files}.\${hiddenfiles}-\${executables}x \$(showsize) \
\${directories}.\${hiddendirectories}d\${links}\${devices}\
$sepacolor ][ $upcolor\${loaddiff}$sepacolor ][ \
$pscol\$(ps ax | wc -l | sed -e \"s: ::g\")proc $sepacolor]\
\n$sepacolor[ $wdircolor\$(truncpwd) $sepacolor]$fontcolor $ "
fi

elif [[ $pstyle == job ]]; then

function jobcount {
   jobs | wc -l | tr -d " "
}

if [[ $enabcol == false ]]; then
	PS1="\n\u @ \h \$(truncpwd) [ `jobcount` ] \$ "
else	PS1="\n$usercolor\u $fontcolor@ $hostcolor\h $wdircolor\$(truncpwd) $sepacolor[$pscol `jobcount` $sepacolor]$fontcolor $ "
fi

elif [[ $enabcol == true && $pstyle == elite ]]; then

PS1="\n\
$pscol┌─$sepacolor( $usercolor\u $fontcolor@ $hostcolor\h$sepacolor )$pscol─\
$sepacolor($pscol job #\# / \$(showtty)$sepacolor )$pscol─$sepacolor( $datecolor\$(date +%I:%M%P)\
$pscol : $datecolor\$(date +%m/%d/%y)$sepacolor )\n\
$pscol└─$sepacolor( $usercolor\$$pscol : $wdircolor\$(truncpwd)$sepacolor )\
$pscol·>$fontcolor "

elif [[ $enabcol == false && $pstyle == elite ]]; then

PS1="\n\
┌─( \u @ \h )─( job #\# / \$(showtty) )─( \$(date +%I:%M%P)\
 : \$(date +%m/%d/%y) )\n└─( $ : \$(truncpwd) )·> "

elif [[ $enabcol == false && $pstyle == dirks ]]; then

PS1="\n\
┌─[ \$(truncpwd) ]\n\
└─[ \u @ \H / \$(showtty) ( \t ) $SHLVL ]·> "

elif [[ $enabcol == true && $pstyle == dirks ]]; then

PS1="\n\
$pscol┌─$sepacolor[ $wdircolor\$(truncpwd) $sepacolor]\n\
$pscol└─$sepacolor[ $usercolor\u $fontcolor@ $hostcolor\H $fontcolor/ $pscol\$(showtty) $sepacolor( $timecolor\t $sepacolor) $pscol$SHLVL $sepacolor]$pscol·>$fontcolor "

elif [[ $enabcol == true && $pstyle == minimal ]]; then

PS1="\n$usercolor\u $wdircolor\$(truncpwd)$pscol \$$fontcolor "

elif [[ $enabcol == false && $pstyle == minimal ]]; then

PS1="\n\u \$(truncpwd) $ "

elif [[ $enabcol == true && $pstyle == dot_prompt ]]; then

PS1="\n$pscol.:$sepacolor[ $usercolor\u$pscol @ $hostcolor\h$sepacolor ]$pscol:. .:$sepacolor[ $wdircolor\$(truncpwd)$sepacolor ]$pscol:.\n.:$sepacolor[·>$fontcolor "

elif [[ $enabcol == false && $pstyle == dot_prompt ]]; then

PS1="\n.:[ \u @ \h ]:. .:[ \$(truncpwd) ]:.\n.:[·> "

elif [[ $enabcol == true && $pstyle == bracket ]]; then

PS1="\n$pcol≺ ⁐ ⊐$usercolor \u$fontcolor  $hostcolor\h $pscol⊏ ⁐ ≻
$fontcolor $wdircolor\$(truncpwd) $fontcolor "

elif [[ $enabcol == false && $pstyle == bracket ]]; then

PS1="\n≺ ⁐ ⊐ \u  \h ⊏ ⁐ ≻\n \$(truncpwd)  "

elif [[ $enabcol == true && $pstyle == sepa_ng ]]; then

PS1="\n$sepacolor⊏⁅ $usercolor\u$pscol ⁑ $hostcolor\h $sepacolor⁆⁅ $datecolor\d $pscol⁑ $timecolor\t$pscol ⁑ $upcolor\$(showuptime)$sepacolor ⁆⊐
⊏⁅$wdircolor \$(truncpwd) $sepacolor⁆⊐≻$fontcolor "

elif [[ $enabcol == false && $pstyle == sepa_ng ]]; then

PS1="\n⊏⁅ \u ⁑ \h ⁆⁅ \d ⁑ \t ⁑ \$(showuptime) ⁆⊐\n⊏⁅ \$(truncpwd) ⁆⊐≻ "

else PS1="\u@\h\w: "

fi
fi

export PS1

export PS2="$pscol $ps234char$fontcolor "
export PS3="$pscol $ps234char$ps234char$fontcolor "
export PS4="$pscol $ps234char$ps234char$ps234char$fontcolor "

WelcomeMessage=$(gconftool-2 --get /apps/bashstyle/welcome_message)

if [[ $pstyle != clock-ad && $pstyle != clock ]]; then
	clear
	bash -c "$WelcomeMessage"
fi
