NEW! April 6, 2016: xttitle Github Repository
On September 27, 1999, I took a small utility that I had written and packaged it as open source. That utility was xttitle.
I had originally written it sometime around 1995 while working on a project that used Sun workstations and servers, running Solaris 2.5. I didn't have root access, and at the time I was using tcsh as my login shell (My choices were sh, csh, and tcsh). I knew the ANSI escape codes to set the icon name and title of an xterm window, and originally used "echo" in an alias for "cd" to do this, but I rewrote the commands in C so it'd (hopefully) be a tiny bit faster.
.tcshrc example: setenv user=`whoami` setenv hostname=`uname -n` alias cd 'chdir \!*;xttitle $user@$hostname\:$cwd $hostname'
Having been a fan of UNIX since the early 1990s, as well as a relatively early adopter of Linux, I decided to take it as an example and create Redhat RPMs for public consumption. I did this mainly as a learning exercise to learn how to use autoconf and automake, as well as how to build my own RPM files using the Redhat package manager. Ironically enough, Redhat (the distribution I originally wrote the package for) has never included the xttitle package with with their distribution, not even as part of the Fedora project.
The actual code is very simple and hasn't changed in over a decade. Over the years it's been picked up by various other Linux distributions and included as an optional package. To be honest, I personally don't use it any more, since .bashrc files come configured with ANSI escape codes by default in every Linux distribution I've used for years. However, I'm delighted that a weekend learning exercise is perhaps still providing value and proving useful to somebody!
Below is a more modern way that I still use xttitle, now that modern X terminal programs support tabbed sessions. If I have multiple sessions open on multiple servers, I can do a "tail -F" on various log files, and then see at a glance which session is what.
root@localhost:~# xttitle "webserver logs" && tail -F /var/log/httpd/*.log
Here are some links to the various project pages and other pages mentioning xttitle. Please note that I have no role in maintaining any current packages, so please direct any questions to the package maintainer for your particular distribution:
Last updated: April 6, 2016 by Michael Jarvis