On Wed Jun 28 2000 at 11:50, Antony Stace wrote to several of the
vger linux mailing lists:
> Is there any way that I can display the current time in an xterm title
> bar?
Easy, almost trivial. You can do that and MUCH more besides.
case "$TERM" in
*xterm* )
PS1='\[\033]0;'
PS1="$PS1"'\u@\h-\w-${COLUMNS}x${LINES}-'
PS1="$PS1"'\t'
PS1="$PS1"'\007\]'
;;
*) PS1='' ;;
esac
PS1="$PS1"'\[\033[1;32;44;37m\]['
PS1="$PS1"'\[\033[33m\]\u'
PS1="$PS1"'\[\033[37m\]@'
PS1="$PS1"'\[\033[33m\]\h'
PS1="$PS1"'\[\033[37m\]:'
PS1="$PS1"'\[\033[33m\]\W'
PS1="$PS1"'\[\033[37m\]]'
PS1="$PS1"'\[\033[37m\]$'
PS1="$PS1"'\[\033[0;1;33m\] '
export PS1
You might not like colours, but I do :) Very handy if you have
terms open to lots of different computers.
Tweak that to your heart's content. Beware of how this works... it
is well documented in the bash(1) man page, but there is a real
trick to getting the extra colour codes in there properly "escaped"
(with \[ and \]) so that it doesn't give any hassles with long
command lines.
Cheers
Tony
-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-
Tony Nugent <[EMAIL PROTECTED]> Systems Administrator, RHCE
GrowZone OnLine (a project of) GrowZone Development Network
POBox 475 Toowoomba Oueensland Australia 4350 Ph: 07 4637 8322
-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-=*#*=-
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs