#!/bin/sh 
# Script initially from Stu Champion (schampio) of Data General 
#  xtitle [t_string [i_string]] Post a string to the window titlebar & icon 
#        Default title string is `hostname`(user):`pwd`  [$LOGNAME] 
#        Default icon  string is `hostname`(user) 
#  Examples of use:  xtitle "title_crichard@felix"  "icon_c@felix" 
#                    xtitle               <Default title. Default icon> 
#                    xtitle "" "c@xyz"    <Default title. Names icon> 
#                    xtitle "abcdef"      <Names title & icon> 
title="$1" 
icon_title="$title" 
if [ "$1" = "" ] ; then 
user=`id -n -u` 
icon_title="`hostname`($user)" 
title="${icon_title}:`pwd`" 
if [ "$user" != "$LOGNAME" ] ; then 
 title=$title" \[$LOGNAME\]" 
fi 
fi 
awk 'BEGIN{printf("%c]1;'"$icon_title"'%c%c]2;'"$title"'%c", 27,7,27,7);exit}' 

