#!/bin/bash
SHORT_HOSTNAME=`hostname | sed 's/\([^\.]*\).*/\1/'`
#LONG_HOSTNAME=`hostname -f`

NOCOLOR="\[\e[0m\]"
BRACKETCOLOR="\[\e[1;30m\]"
DIRCOLOR="\[\e[1;34m\]"
HOSTCOLOR="\[\033[1;32m\]"
[[ ! $(id -u) ]] && HOSTCOLOR="\[\033[1;31m\]SU "

PROMPT_COMMAND='echo -ne "\033]0; $SHORT_HOSTNAME `dirs`\007"'
PS1="$HOSTCOLOR$SHORT_HOSTNAME $BRACKETCOLOR[$DIRCOLOR\w$BRACKETCOLOR] $NOCOLOR"

if ls --color -d . >/dev/null 2>&1; then
    alias ls="ls -lap --color"
elif ls -G -d . >/dev/null 2>&1; then
    alias ls="ls -lapG"
else
    alias ls="ls -lap"
fi

alias cd..="cd .."
LS_COLORS='di=33;01:fi=0:ln=36:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=31;01:*.rpm=90'
export LS_COLORS
