home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / windows / x / 20308 < prev    next >
Encoding:
Text File  |  1992-12-16  |  2.0 KB  |  60 lines

  1. Newsgroups: comp.windows.x
  2. 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
  3. From: bjst@sth.frontec.se (Bjorn Stenberg)
  4. Subject: Re: setting DISPLAY env variable
  5. Message-ID: <1992Dec16.202347.8749@sth.frontec.se>
  6. Nntp-Posting-Host: pop.sth.frontec.se
  7. Organization: IDK/Frontec - System Design Group
  8. References: <1gmgnoINN4bu@sol.deakin.OZ.AU>
  9. Date: 16 Dec 92 20:23:47 GMT
  10. Lines: 48
  11.  
  12. rns@deakin.OZ.AU (Robert Sturrock) writes:
  13. > is there a way to set the DISPLAY variable to be the particular workstation
  14. > you are using inside ".bashrc".  That is, I want every new xterm, for
  15. > whatever host I happen to be logging into, to have DISPLAY set to my
  16. > workstation.
  17.  
  18. There are two solutions to this in the FAQ, one of which includes the use 
  19. of a separate program and one small shell script to start X applications on
  20. other hosts.
  21.  
  22. I have solved this particular problem in a slightly different manner. It
  23. requires all machines to share the user home directories.
  24.  
  25. (NOTE: This works fine for *me*, I'm not saying it is the best or the only
  26. solution!)
  27.  
  28. Basically, we have two questions:
  29.  
  30. 1) Which machine/display should be set as active?
  31. 2) How do we keep this active throughout the entire session?
  32.  
  33. ...and two answers:
  34.  
  35. 1) The one I used the console to log into.
  36. 2) Save the initial hostname in a file in the home directory and resurrect
  37.    it each time we log in to a new host.
  38.  
  39. Verbose version:
  40.  
  41. In .cshrc (or equivalent) add:
  42.  
  43. --------->8--------------------
  44. if ( $tty == 'console' ) then
  45.     hostname > $HOME/.loginhost
  46. endif
  47. setenv DISPLAY `cat $HOME/.loginhost`":0.0"
  48. ---------8<--------------------
  49.  
  50. Note that you may have to alter the syntax to suit your choice of shell. (I
  51. use tcsh 6.00.02.)
  52.  
  53. Hope this helps!
  54.  
  55.         -- Bjorn
  56.  
  57. ---------------------------------------------------------------------------
  58. Bjorn Stenberg, Stockholm, Sweden                       bjst@sth.frontec.se
  59. ---------------------------------------------------------------------------
  60.