home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!think.com!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!ericom!eos.ericsson.se!etxmesa
- From: etxmesa@eos.ericsson.se (Michael Salmon)
- Newsgroups: comp.windows.x
- Subject: Re: setting DISPLAY env variable
- Message-ID: <1992Dec21.130253.1110@ericsson.se>
- Date: 21 Dec 92 13:02:53 GMT
- References: <1gmgnoINN4bu@sol.deakin.OZ.AU> <BzCzvA.42s@constellation.ecn.uoknor.edu> <1h4bp2INNi8u@sol.deakin.OZ.AU>
- Sender: news@ericsson.se
- Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
- Organization: Ericsson Telecom AB
- Lines: 75
- Nntp-Posting-Host: eos6c02.ericsson.se
-
- In article <1h4bp2INNi8u@sol.deakin.OZ.AU>
- rns@deakin.OZ.AU (Robert Sturrock) writes:
- |> dwight@geohub.gcn.uoknor.edu (Dwight D. Moore) writes:
- |>
- |> >Try using "xterm -display wkstn:0" instead of depending on the
- |> >DISPLAY environment variable. There are scripts around that
- |> >will do an rsh and allow you to do the above command without
- |> >explicitly logging into the machine. We have setup window
- |> >manager menus with pulldowns to do just this and popup
- |> >a remote window.
- |>
- |> I don't think this solves the problem. My difficulty is not starting
- |> up an xterm. My problem is logging into a remote machine and having the
- |> DISPLAY variable appropriately set on this machine to "wkstn:0.0".
-
- This should be perhaps put in the FAQ, here is a previous response:
-
- On our Apollo (BSD) systems I do:
-
- set host = `hostname`
- #
- # Set the default X Windows server name - set to the name of the host
- # the user logged in from, unless it was the terminal server (tserver).
- # Also strip off the local domain name (.chem.utoronto.ca) if possible.
- #
- setenv DISPLAY "${host}:0"
- set displayhost=`who am i | sed -e 's/.*(//' -e 's/).*$//' -e 's/\.chem\.utoronto\.ca$//'`
- if ("$#displayhost" == "1") then
- if ("$displayhost" != "tserver") then
- setenv DISPLAY $displayhost\:0
- endif
- endif
- unset displayhost
-
- and on our HP (SYSV-sortof) systems I do:
-
- set host = `hostname`
- #
- # Set the default X Windows server name - set to the name of the host
- # the user logged in from, unless it was the terminal server (tserver).
- # Also strip off the local domain name (.chem.utoronto.ca) if possible.
- #
- setenv DISPLAY "${host}:0"
- tty -s
- if ("$status" == "0") then
- set displayhost=`who am i -R | sed -e 's/.*(//' -e 's/).*$//' -e 's/\.chem\.utoronto\.ca$//'`
- if ("$#displayhost" == "1") then
- if ("$displayhost" != "tserver") then
- setenv DISPLAY $displayhost\:0
- endif
- endif
- unset displayhost
- endif
-
- You will have to surround this with code to only do it for $TERM types
- you want. You'll just have to trust the user hasn't messed with $TERM;
- if the wrong $TERM is propagated from the remote system, tough luck for
- the user. It is possible to send some messages to some terminals
- and check the response (this works for vt100/xterm) so that might be
- a way to check out the terminal type.
- --
- What are the chances that any computer system will ever "work" properly?
- ... and Slim just left town. -*- Mike Peterson, SysAdmin, U/Toronto Chemistry
-
-
- --
-
- Michael Salmon
-
- #include <standard.disclaimer>
- #include <witty.saying>
- #include <fancy.pseudo.graphics>
-
- Ericsson Telecom AB
- Stockholm
-