On Friday 09 Jan 2004 14:13, Andrew Gaffney wrote:
> I routinely have atleast 3 xterm's at any one time. I need a way to
> easily distinguish between them. Is there a command I can run from
> the xterm to change its title to something I specify?

There's a bash-prompt HOWTO that describes how to do this. I customised 
it and put the file "proml" in my home directory, made it executable 
and sourced it in .bashrc or /etc/profile (can't remember exactly).

$ cat proml
function proml
{
local BLACK="\[\033[0;30m\]"
local DARK_GRAY="\[\033[1;30m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
local GRAY="\[\033[1;30m\]"
local WHITE="\[\033[1;37m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local BLUE="\[\033[01;34m\]"

case $TERM in
        xterm*)
                local TITLEBAR='\[\033]0;[EMAIL PROTECTED]:\w\007\]'
                ;;
        *)
                local TITLEBAR=''
                ;;
esac

PS1="${TITLEBAR}\
$LIGHT_GREEN[\
\$(date +%H:%M) \
[EMAIL PROTECTED]: \w]\
$BLUE\n\$ \[\033[00m\]"
PS2='> '
PS4='+ '
}

Peter
-- 
======================================================================
Gentoo Linux:   Portage 2.0.49-r20 (default-x86-1.4, gcc-3.2.3, 
glibc-2.3.2-r3, 2.6.1-rc2-gentoo-w4l)   i686 AMD Athlon(tm) XP 3200+
======================================================================


--
[EMAIL PROTECTED] mailing list

Reply via email to