[Lancaster] perl script to change your xterm title

Richard Robinson RichardRobinson at beulah.qualmograph.org.uk
Wed Jun 4 15:58:00 2003


On Wed, Jun 04, 2003 at 11:23:12AM +0000, Andy Baxter wrote:
> Sometimes when I have a lot of terminal windows open in KDE, it gets 
> confusing which is which, so I wrote a mini perl script to change the 
> window/icon title on the fly using VT102 control characters. The code is as 
> follows:
> 
> #!/usr/bin/perl
> #
> # termname - change icon and window name of this terminal.
> #
> 
> print chr(27)."]0;$ARGV[0]".chr(7);
> 
> 
> so if you stick this in /usr/local/bin as 'termname' then 
> 
> chmod 755 termname
> 
> you'll be able to type 
> 
> termname "frabjous day"
> 
> and the window and icon title will change to 'frabjous day'.
>...
> Do I get the 'sad linux geek' badge and t-shirt?

I'd say so ... that's neat, thanks.

What's going on here, are these the old ANSI control characters ?


-- 
Richard Robinson
"The whole plan hinged upon the natural curiosity of potatoes" - S. Lem