# this snippet is for /etc/profile or your personal rc file.  if installed
# in /etc/profile, advise your users to make a file ~/.settings and stick a
# line in there that has:
#  TITLEBAR=yes
#
# their terminal program must support the display ID call
#
#  -d

# setup environment
if [ -e ~/.settings ]; then
    . ~/.settings
fi

# does the user want his titlebar set?
if [ "x$TITLEBAR" = "xyes" ]; then
  echo -ne Checking for titlebar capability
  stty -icanon -echo min 0 time 20
  echo -ne '\033[7n'
  read term_id
  display=$(echo $term_id|sed '/.*:0/!d')
  if [ x$display != x ]; then    
    export PS1='\[\033]2; ($(date +%l:%M%p)) \u@\h \w\007\033]1;\u@\h\007\]\$ '
  fi
  echo -ne '\033[2K\r'
  stty icanon echo
fi
