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

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