home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / windows / x / 21086 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.0 KB  |  38 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!enterpoop.mit.edu!bloom-beacon!INTERNET!dont-send-mail-to-path-lines
  3. From: glen@iis.UUCP
  4. Subject: Re: DISPLAY capture
  5. Message-ID: <9301122336.AA09535@rigel>
  6. Sender: root@athena.mit.edu (Wizard A. Root)
  7. Organization: The Internet
  8. Date: Tue, 12 Jan 1993 23:36:18 GMT
  9. Lines: 27
  10.  
  11. > I would like to know how the UNIX .profile or .cshrc file can be set to 
  12. > capture the IP address of the terminal you log into so that the DISPLAY
  13. > variable can be automatically set for a X session.
  14. Put the following in your .login:
  15.  
  16. # Set the DISPLAY variable automatically on rlogins to different machines
  17. setenv HOST    `hostname`
  18. setenv DISPLAY unix:0.0
  19. set me = `who am i`     
  20. if ($#me == 6) then
  21.     setenv DISPLAY `echo $me[6] | sed 's/(\([^:]*\).*)/\1:0/'`
  22.     if ($DISPLAY == "unix:0") then
  23.         setenv DISPLAY "${HOST}:0"
  24.     endif
  25. endif
  26. unset me
  27.  
  28. --------------------------------
  29. Glen R. Geisen
  30. glen@iis.sun.com
  31.  
  32. International Imaging Systems
  33. Milpitas, California, USA
  34. 408.432.3400 x251
  35. --------------------------------
  36.