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

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 enabmem=$(gconftool-2 --get /apps/bashstyle/show_mem)

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

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

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

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

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

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

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

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

	if [[ $enabsize == true ]]; then
		PS1+="$wdircolor 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

	if [[ $enabload == true ]]; then
		PS1+=" $sepacolor$sepa$upcolor system load: \$(showload)"
	fi

	if [[ $enabproc == true ]]; then
		PS1+=" $sepacolor$sepa$pscolor processes: \$(proccount)"
	fi

	if [[ $enabbatt == true ]]; then
		PS1+=" $sepacolor$sepa$pscolor battery: \$(showbatteryload)"
	fi

	if [[ $enabmem == free ]]; then
		PS1+=" $sepacolor$sepa$usercolor free mem: $pscolor\$(showmem --free)$usercolor mb"
	elif [[ $enabmem == used ]]; then
		PS1+=" $sepacolor$sepa$usercolor used mem: $pscolor\$(showmem --used)$usercolor mb"
	elif [[ $enabmem == both ]]; then
		PS1+=" $sepacolor$sepa$usercolor free$sepacolor/${usercolor}used mem: $pscolor\$(showmem --free)$sepacolor/$pscolor\$(showmem --used)$usercolor mb"
	fi

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

else

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

	if [[ $enablf == true ]]; then
		PS1+=" files: \$(fdnl -f)"
	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

	if [[ $enabload == true ]]; then
		PS1+=" $sepa system load: \$(showload)"
	fi

	if [[ $enabproc == true ]]; then
		PS1+=" $sepa processes: \$(proccount)"
	fi

	if [[ $enabbatt == true ]]; then
		PS1+=" $sepa battery: \$(showbatteryload)"
	fi

	if [[ $enabmem == free ]]; then
		PS1+=" $sepa free mem: \$(showmem --free) mb"
	elif [[ $enabmem == used ]]; then
		PS1+=" $sepa used mem: \$(showmem --used) mb"
	elif [[ $enabmem == both ]]; then
		PS1+=" $sepa free/used mem: \$(showmem --free)/\$(showmem --used) mb"
	fi

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

fi

export PS1
