home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / 20435 < prev    next >
Encoding:
Text File  |  1992-12-21  |  3.1 KB  |  89 lines

  1. 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
  2. From: etxmesa@eos.ericsson.se (Michael Salmon)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: setting DISPLAY env variable
  5. Message-ID: <1992Dec21.130253.1110@ericsson.se>
  6. Date: 21 Dec 92 13:02:53 GMT
  7. References: <1gmgnoINN4bu@sol.deakin.OZ.AU> <BzCzvA.42s@constellation.ecn.uoknor.edu> <1h4bp2INNi8u@sol.deakin.OZ.AU>
  8. Sender: news@ericsson.se
  9. Reply-To: etxmesa@eos.ericsson.se (Michael Salmon)
  10. Organization: Ericsson Telecom AB
  11. Lines: 75
  12. Nntp-Posting-Host: eos6c02.ericsson.se
  13.  
  14. In article <1h4bp2INNi8u@sol.deakin.OZ.AU>
  15. rns@deakin.OZ.AU (Robert Sturrock) writes:
  16. |> dwight@geohub.gcn.uoknor.edu (Dwight D. Moore) writes:
  17. |> 
  18. |> >Try using "xterm -display wkstn:0" instead of depending on the
  19. |> >DISPLAY environment variable.  There are scripts around that
  20. |> >will do an rsh and allow you to do the above command without
  21. |> >explicitly logging into the machine.  We have setup window
  22. |> >manager menus with pulldowns to do just this and popup
  23. |> >a remote window.
  24. |> 
  25. |> I don't think this solves the problem.  My difficulty is not starting
  26. |> up an xterm.  My problem is logging into a remote machine and having the
  27. |> DISPLAY variable appropriately set on this machine to "wkstn:0.0".
  28.  
  29. This should be perhaps put in the FAQ, here is a previous response:
  30.  
  31. On our Apollo (BSD) systems I do:
  32.  
  33. set host = `hostname`
  34. #
  35. # Set the default X Windows server name - set to the name of the host
  36. # the user logged in from, unless it was the terminal server (tserver).
  37. # Also strip off the local domain name (.chem.utoronto.ca) if possible.
  38. #
  39. setenv DISPLAY "${host}:0"
  40. set displayhost=`who am i | sed -e 's/.*(//' -e 's/).*$//' -e 's/\.chem\.utoronto\.ca$//'`
  41. if ("$#displayhost" == "1") then
  42.    if ("$displayhost" != "tserver") then
  43.       setenv DISPLAY $displayhost\:0
  44.    endif
  45. endif
  46. unset displayhost
  47.  
  48. and on our HP (SYSV-sortof) systems I do:
  49.  
  50. set host = `hostname`
  51. #
  52. # Set the default X Windows server name - set to the name of the host
  53. # the user logged in from, unless it was the terminal server (tserver).
  54. # Also strip off the local domain name (.chem.utoronto.ca) if possible.
  55. #
  56. setenv DISPLAY "${host}:0"
  57. tty -s
  58. if ("$status" == "0") then
  59.    set displayhost=`who am i -R | sed -e 's/.*(//' -e 's/).*$//' -e 's/\.chem\.utoronto\.ca$//'`
  60.    if ("$#displayhost" == "1") then
  61.       if ("$displayhost" != "tserver") then
  62.          setenv DISPLAY $displayhost\:0
  63.       endif
  64.    endif
  65.    unset displayhost
  66. endif
  67.  
  68. You will have to surround this with code to only do it for $TERM types
  69. you want. You'll just have to trust the user hasn't messed with $TERM;
  70. if the wrong $TERM is propagated from the remote system, tough luck for
  71. the user. It is possible to send some messages to some terminals
  72. and check the response (this works for vt100/xterm) so that might be
  73. a way to check out the terminal type.
  74. -- 
  75. What are the chances that any computer system will ever "work" properly?
  76. ... and Slim just left town. -*- Mike Peterson, SysAdmin, U/Toronto Chemistry
  77.  
  78.  
  79. -- 
  80.  
  81. Michael Salmon
  82.  
  83. #include    <standard.disclaimer>
  84. #include    <witty.saying>
  85. #include    <fancy.pseudo.graphics>
  86.  
  87. Ericsson Telecom AB
  88. Stockholm
  89.