home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / maillis / xwindow / 18790 < prev    next >
Encoding:
Text File  |  1992-12-21  |  3.2 KB  |  94 lines

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