Re: Label the Terminal window



I forgot to send this to the list, just to the original poster. Whoops.
For the benefit of anyone else with a dozen windows who forgets what's
in which:

On Sat, Feb 12, 2000 at 04:36:53PM -0600 or thereabouts, Firedog@icekitten.com wrote:
> How do you label a terminal windows ? I have 6 or 7 open at all times and
> get confused which one is running what sometimes.

The real answer: if you poke about in your documentation for XFree86
(sometimes, eg on Red Hat, there is a separate XFree86-doc package)
you will eventually find an incomprehensive, gzipped, postscript
file which tells you about control sequences to alter many things
and one of them is the title on your window.

The easy answer that doesn't work: pester gnome-terminal authors to
add a "Change titlebar to..." menu option. (Don't try this, they'll
kill me because they've already explained to me about eight times
that it's (a) bloat and (b) a bit more of a problem than it sounds
to write well.)

The easy answer that works: post here, and I reply with my magic
shellscripts that I'm very proud of which include the control
characters: put one of these somewhere, chmod 755 it (so it's 
executable, basically), and run it in the window whose title you
want to change. 

         ------------
#!/bin/sh

# How to make your xterm, gnome-terminal, etc, have a new title if
# you didn't start it with xterm --title or gnome-terminal --title.

echo "What do you want to call this window?"
read title
printf "\033]0;$title\007"
echo "Changed title to $title"
         -------------

Or

         --------------
#!/bin/sh

# How to make your xterm, gnome-terminal, etc, have a new title if
# you didn't start it with xterm --title or gnome-terminal --title.
#
# $* is "whatever you typed as an argument when you ran the script"
# So 'titlebar.sh Horace' gives you a window called Horace if this
# file is called titlebar.sh. You can put spaces in the title, btw.

printf "\033]0;$*\007"
echo "Changed window title to $*"

         --------------

It took me about a day to figure this out. Don't laugh. That's my
GNOME contribution for the year. :)

Telsa (currently with ten gnome-terminals open, so knows why you
wanted this!)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]