Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!orstcs!ogicse!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!uunet!orca.dsd.es.com!es.com!bsteinke From: bsteinke@es.com (Bruce Steinke) Newsgroups: comp.windows.x Subject: Re: How to specify Xterm icon position in command line? Message-ID: <1990Dec20.212805.16439@dsd.es.com> Date: 20 Dec 90 21:28:05 GMT References: <47975@siemens.siemens.com> <164522.12631@timbuk.cray.com> Sender: news@dsd.es.com Reply-To: bsteinke@es.com (Bruce Steinke) Distribution: usa Organization: Evans & Sutherland Computer Corp., Salt Lake City, UT Lines: 61 [ part a deleted ] |> |> |> |> (b) In SunView/OpenWindows, the title bar for ShellTool/CmdTool can be |> |> altered by using the alias : |> |> alias header "echo -n "^[]l!*^[\" |> |> and then using the command : |> |> header where is any string. |> |> I use this to display the current user/machine/directory on the title bar. |> |> However, I have not been able to use this on an xterm. |> |> |> echo -n "^[]0;\!*^G" works. The 0 after ] indicates that both the icon label |> and window label are to be changed. I use a short shell script (placed in a local bin) in combination with some aliases to keep my title bar current at all times. The shell script: ======== #!/bin/sh ## shell script to change the title on an xterm window and/or its icon. if [ $# -ne 2 ] then echo "Usage: xtitle { -t | -i | -b } string" else ESC="" ND=";" NP="" if [ "$1" = -t ] then echo "${ESC}]2${ND}$2${NP}" elif [ "$1" = -i ] then echo "${ESC}]1${ND}$2${NP}" elif [ "$1" = -b ] then echo "${ESC}]0${ND}$2${NP}" else echo "Usage: xtitle { -t | -i | -b } string" fi fi ======== The aliases: =========== alias cd 'cd \!* ; xtitle -b " `hostname`: `pwd` "' alias pd 'pushd \!* ; xtitle -b " `hostname`: `pwd` "' alias pd1 'pushd +1 \!* ; xtitle -b " `hostname`: `pwd` "' alias pd2 'pushd +2 \!* ; xtitle -b " `hostname`: `pwd` "' alias pd3 'pushd +3 \!* ; xtitle -b " `hostname`: `pwd` "' alias pd4 'pushd +4 \!* ; xtitle -b " `hostname`: `pwd` "' alias po 'popd ; xtitle -b " `hostname`: `pwd` "' ============ Happy Holidays! -- Bruce F. Steinke | "And the road goes ever on..." bsteinke@dsd.es.com | Bilbo Baggins Evans & Sutherland Computer Corp. | Salt Lake City, Utah | No moss under these feet!