• warning: Division by zero in /var/www/web7/web/includes/image.inc on line 125.
  • warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /var/www/web7/web/includes/image.inc on line 238.
  • warning: imagecolorallocatealpha(): supplied argument is not a valid Image resource in /var/www/web7/web/includes/image.inc on line 240.
  • warning: imagealphablending(): supplied argument is not a valid Image resource in /var/www/web7/web/includes/image.inc on line 241.
  • warning: imagefilledrectangle(): supplied argument is not a valid Image resource in /var/www/web7/web/includes/image.inc on line 242.
  • warning: imagealphablending(): supplied argument is not a valid Image resource in /var/www/web7/web/includes/image.inc on line 243.
  • warning: imagesavealpha(): supplied argument is not a valid Image resource in /var/www/web7/web/includes/image.inc on line 244.
  • warning: imagecopyresampled(): supplied argument is not a valid Image resource in /var/www/web7/web/includes/image.inc on line 264.
  • warning: imagepng(): supplied argument is not a valid Image resource in /var/www/web7/web/includes/image.inc on line 342.
  • warning: imagedestroy(): supplied argument is not a valid Image resource in /var/www/web7/web/includes/image.inc on line 267.
  • Unable to create scaled Original image

X terminal titles

Tags:

In the Advanced Bash Scripting Guide (pdf) , I recently came across the following snippet in an example .bashrc file.


function xtitle ()
{
case $TERM in
*term | rxvt)
echo -n -e "\033]0;$*\007" ;;
*) ;;
esac
}

The xtitle function allows you to name the X terminal window. I am a big fan of tabbed terminal emulators, but one drawback has been not knowing what is displayed in a hidden tab. Let's say you want to view several gzipped files using zless. First add the following to your .bashrc file:


function xtitle ()
{
case $TERM in
*term | rxvt)
echo -n -e "\033]0;$*\007" ;;
*) ;;
esac
}
#
# list functions that use xtitle after xtitle itself
#
function zless ()
{
xtitle zless "$*"
/bin/zless $*
}

Then the next terminal you open will change its title when you invoke zless. I find this ability to name the terminal window especially useful for editors that run within a terminal window. The last thing I want to do is lose track of files I am editing.

0
Syndicate content