Re: FVWM: Dynamic Xterm title fix

From: Albrecht Kadlec <albrecht_at_auto.tuwien.ac.at>
Date: Wed, 19 Jun 96 11:57:51 +0200

>>>>> Jonathan Watson writes:

J> I have been using the cwdcmd feature in tcsh to dynamically change the
J> titles of my xterms. Currently I have X setup so that I have a
using the prompt is much faster than using the cwdcmd alias, since the
alias has to execute external commands (the version with the variables did
never work), and the prompt syntax has a %? specification for almost
everything:

I use this in my .cshrc:
if ($?tcsh == 0) exit
...
if ($term == xterm) then
# alias cwdcmd 'echo "^[]2;${HOST}:$cwd^G^[]1;${HOST}^G"'
        set prompt="%{\e]2\;%m:%B%~%b^g\e]1\;%m^g\r%}%T %B%m:%~%#%b "
else


J> "controller" xterm....To quit X I exit/kill/destroy this particular Xterm
J> and the window manager/X/apps go down.
J> In my .xsession I label the "controller" xterm CONTROLLER, but when my .cshrc
J> executes, cwdcmd overrides the title set in my .xsession with the -title
J> switch and changes the name of the xterm. I have tried inserting a -e
J> switch in the xterm call so that I could execute a special script or set
J> an enviornment variable to identify the controller xterm or change the
J> cwdcmd alias for that xterm, but it didn't work. I have 2 major problems.

J> 1. Any attempt to set an enviornment variable from the -e fails. (ie. setenv
J> CONTROLLER 1).
guess so. you could only do an xterm -e tcsh -c script
and have a setenv in the script

or use -l (? - our manual pages on tcsh are not up-to-date).

J> 2. The .cshrc and shell setup scripts execute AFTER whatever I specify in
J> the xterm call with the -e switch.
hint: the .login comes after .cshrc

J> From these observations an various experiments I thought that if
J> I could read the title of the xterm within my .cshrc and use it (the
J> title) in an if statement I could then have the cwdcmd changed for that
J> specific xterm.

J> SO, my question is:
J> How do you get the title of an xterm from within a shell script??
don't think this is possible.

J> Any other solutions to this problem??

I do sth similar:
I have a CONSOLE ( -C switch) xterm whih is 70x4 and swallowed into my
buttonbar which in term is sticky. (So I can always start any program and
see any Console Messages. Also, since it's the first xterm which is
started, all write & talk messages go there.)

My prompt normally looks like "time hostname:path>" But since that xterm is
rather small and I know which machine I'm on (physically), I set my prompt
just to time path> in my .login. Since the console is the only xterm which
is started with -ls, and .login is executed after .cshrc, the former
overwrites the latter.


so in short: I do my usual setup in .cshrc, my console is

*FvwmButtons(10x2, Swallow (UseOld, NoClose, Respawn) "Console" \
"Exec xterm -name Console -ls -C -display $HOSTDISPLAY -geometry 70x5-1500-1500")

and my .login contains:

unset visiblebell # Console is the only xterm that may beep
set watch=(1 any any) # keep track of logins
set prompt="%T %B%~%#%b " # short prompt


hope this helps.
albrecht
-- 
Peace on earth and mercy mild, Mother Brown has lost her child
 - Just another Forgotten Son				-- Marillion
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed Jun 19 1996 - 05:07:32 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST