There is some old magic concerning this that I have mostly forgotten. But as 
you probably are aware, the title of the window (and all the decoration around 
the windows contents) is in fact rendered by the window manager. So when an X 
application starts, it informs the window manager what it would like it's title 
to be (and how big it needs the windows,etc). These "hints" can often be 
ignored by the window manager if it sees fit.
 
There is also some messaging/APIs that allow one to dynamically communicate 
with the window manager (ICCCM is the old one and it looks like EWMH is 
something new.) I can remember hacking some C code for X way back in the early 
nineties' that did things like this with the window manager. Googling though, I 
found two ready-made command line utilities that look useful 
 
xtitle - http://www.cs.indiana.edu/~kinzler/xtitle/
 
wmctl - http://sweb.cz/tripie/utils/wmctrl/
 
wmctl looks pretty powerful if you want to be able script a whole lot of things 
that your window manager should do.
 
(Clearly as already been said, you will probably need to disable/change the 
dynamic prompt stuff in .bashrc)
 
Interestingly, neither of these seem to be available in standard packages - I 
guess hacking window title isn't considered mainstream ;-)
 
 
Regards, Martin
 
Martin Visser

Technology Consultant
Consulting & Integration
Technology Solutions Group - HP Services

410 Concord Road
Rhodes NSW  2138
Australia

Mobile: +61-411-254-513
Fax: +61-2-9022-1800    
E-mail: martin.visserAThp.com

This email (including any attachments) is intended only for the use of
the individual or entity named above and may contain information that is
confidential, proprietary or privileged. If you are not the intended
recipient, please notify HP immediately by return email and then delete
the email, destroy any printed copy and do not disclose or use the
information in it.



________________________________

From: [EMAIL PROTECTED] on behalf of Michael Davies
Sent: Wed 23/08/2006 4:57 PM
To: Luke Vanderfluit
Cc: [email protected]
Subject: Re: [SLUG] change title of xterm window



On 8/23/06, Luke Vanderfluit <[EMAIL PROTECTED]> wrote:
> I use lots of xterms on my screen.
> I'd like to be able to change the title of the xterm window, by type in it at 
> the prompt.
>
> Anyone know how to do this?

Going back to ancient history, I found this mouthfull in my .cshrc file

set frobnicate = "some string"
set prompt="%{\e]2\;${frobnicate}^g\e]1\;%m^g\r%}%B%m:%n:%c4:%h%#%b "

You need to send control chars to the xterm, you can do that via the
prompt under tcsh.  That doesn't translate directly into bash, but
should start you on the right track.

Alternatively you can google for "xterm bash title change" and feel
lucky.   Reading http://www.faqs.org/docs/Linux-mini/Xterm-Title.html
tells us that:

PROMPT_COMMAND='echo -ne "\033]0;${FROBNICATE}\007"'
FROBNICATE="some string"

What is quite useful is that you only need to change ${FROBNICATE} to
change the title dynamically.

HTH,

Michael...
--
Michael Davies               "Do what you think is interesting, do
mailto:[EMAIL PROTECTED]   something that you think is fun and
http://michaeldavies.org <http://michaeldavies.org/>       worthwhile, because 
otherwise you won't
                              do it well anyway." -- Brian Kernighan
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to