#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2008        Ayo                             #
#							#
#########################################################

host=${HOSTNAME/.*}

function pre_prompt {

newPWD="${PWD}"
let promptsize=$(echo -n "--( $(whoami) @ $host ee, dd mmm yy )( ${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="...${PWD:${cutt}}"
fi

}

PROMPT_COMMAND=pre_prompt

PS1="${color_separator}┌─(${color_user} \u${color_font} @ ${color_host}\h\
${color_date} \$(date \"+%a, %d %b %y\")${color_separator} )─\${fill}─(${color_wdir} \${newPWD} \
${color_separator})─<\n${color_separator}└─(${color_time} \$(date \"+%H:%M\")${color_user} \$(showuser)${color_separator} )─>${color_font} "

