#!/bin/sh - PATH=/bin:/usr/bin; export PATH # xtitle - set window title and icon name for an X11 terminal window # Steve Kinzler, kinzler@cs.indiana.edu, Nov 93/Nov 98/Mar 00 # see website http://www.cs.indiana.edu/~kinzler/xtitle/ # http://www.cs.indiana.edu/~kinzler/home.html#x11 # An older version of this script (not recommended for use in dtterm's) # is packaged for Solaris and available at # http://metalab.unc.edu/pub/solaris/sparc/ version=1.0.0 dflttarg=ti target=; bad= while : do case $# in 0) break;; *) case "$1" in -[tiq]*) target="$target$1";; --) shift; break;; -h) bad=t; break;; -*) bad=t; echo "$0: unknown option ($1)" 1>&2;; *) break;; esac shift;; esac done case "$#,$bad" in 0,*|*,?*) cat << EOF 1>&2 usage: $0 [ -tiq ] string ... -t set window title -i set icon name -q quiet mode, don't report settings Without -t or -i options, both the window title and icon name are set. Version $version EOF exit 1;; esac case "$target" in ''|-q) target="$target$dflttarg";; esac case "$target" in *t*) case "$target" in *q*) echo "]2;$*" | tr -d '\012';; *) echo "]2;$*title = $*";; esac;; esac case "$target" in *i*) case "$target" in *q*) echo "]1;$*" | tr -d '\012';; *) echo "]1;$*icon = $*";; esac;; esac