home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / maillis / xwindow / 18798 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.7 KB

  1. Path: sparky!uunet!stanford.edu!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
  2. From: graaff@duticai.twi.tudelft.nl (Hans de Graaff)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: setting DISPLAY env variable
  5. Message-ID: <1992Dec21.192644.7363@sm.sony.co.jp>
  6. Date: 21 Dec 92 19:26:44 GMT
  7. Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
  8. Distribution: fj
  9. Organization: Delft University of Technology
  10. Lines: 35
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: 21 Dec 92 13:33:33 GMT
  14. Message-Id: <BzM2zx.J7M@dutiws.twi.tudelft.nl>
  15. Newsgroups: comp.windows.x
  16. References: <1h4bp2INNi8u@sol.deakin.OZ.AU>
  17. Sender: xpert-request@expo.lcs.mit.edu
  18.  
  19. In article 1h4bp2INNi8u@sol.deakin.OZ.AU, rns@deakin.OZ.AU (Robert Sturrock) writes:
  20. >I don't think this solves the problem.  My difficulty is not starting
  21. >up an xterm.  My problem is logging into a remote machine and having the
  22. >DISPLAY variable appropriately set on this machine to "wkstn:0.0".
  23.  
  24. I got this from the net some time ago, and I've used it for some time now.
  25. I use this in my .login
  26.  
  27. --
  28.  
  29. # make it so that the DISPLAY points to the machine I'm sitting at...
  30. set callerid=`who am i | sed -e 's/^.*(//' -e 's/)$//' -e 's/\.[-a-zA-Z]*$//' `
  31.  
  32. # callerid is either the current display (:0.0), or the host (foo.bar)
  33. set test = `echo $callerid | sed -e 's/^.*:.*//'`
  34.  
  35. if ($#test == 1) then
  36.     setenv DISPLAY $callerid\:0.0
  37. else
  38.     setenv DISPLAY `hostname`:0.0
  39. endif
  40.  
  41. unset test
  42. ---
  43. Hans de Graaff                  | I want someone to follow,
  44. J.J.deGraaff@IS.TWI.TUDelft.NL  |   who doesn't lead the way
  45. Department of Informatics       | I want someone to listen,
  46. Delft University of Technology  |   who won't repeat what I say
  47.                Room: 2.003, Telephone: +31-15-78-5811 
  48.