home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!mailgzrz.TU-Berlin.DE!news.netmbx.de!Germany.EU.net!mcsun!sunic!seunet!pop!bjst
- From: bjst@sth.frontec.se (Bjorn Stenberg)
- Subject: Re: setting DISPLAY env variable
- Message-ID: <1992Dec16.202347.8749@sth.frontec.se>
- Nntp-Posting-Host: pop.sth.frontec.se
- Organization: IDK/Frontec - System Design Group
- References: <1gmgnoINN4bu@sol.deakin.OZ.AU>
- Date: 16 Dec 92 20:23:47 GMT
- Lines: 48
-
- rns@deakin.OZ.AU (Robert Sturrock) writes:
- > is there a way to set the DISPLAY variable to be the particular workstation
- > you are using inside ".bashrc". That is, I want every new xterm, for
- > whatever host I happen to be logging into, to have DISPLAY set to my
- > workstation.
-
- There are two solutions to this in the FAQ, one of which includes the use
- of a separate program and one small shell script to start X applications on
- other hosts.
-
- I have solved this particular problem in a slightly different manner. It
- requires all machines to share the user home directories.
-
- (NOTE: This works fine for *me*, I'm not saying it is the best or the only
- solution!)
-
- Basically, we have two questions:
-
- 1) Which machine/display should be set as active?
- 2) How do we keep this active throughout the entire session?
-
- ...and two answers:
-
- 1) The one I used the console to log into.
- 2) Save the initial hostname in a file in the home directory and resurrect
- it each time we log in to a new host.
-
- Verbose version:
-
- In .cshrc (or equivalent) add:
-
- --------->8--------------------
- if ( $tty == 'console' ) then
- hostname > $HOME/.loginhost
- endif
- setenv DISPLAY `cat $HOME/.loginhost`":0.0"
- ---------8<--------------------
-
- Note that you may have to alter the syntax to suit your choice of shell. (I
- use tcsh 6.00.02.)
-
- Hope this helps!
-
- -- Bjorn
-
- ---------------------------------------------------------------------------
- Bjorn Stenberg, Stockholm, Sweden bjst@sth.frontec.se
- ---------------------------------------------------------------------------
-