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