home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!manuel.anu.edu.au!markus
- From: markus@octavia.anu.edu.au (Markus Buchhorn)
- Newsgroups: comp.windows.x
- Subject: Re: setting DISPLAY env variable
- Date: 16 Dec 1992 22:22:10 GMT
- Organization: Australian National University, Canberra
- Lines: 34
- Distribution: world
- Message-ID: <1goa6iINNfc9@manuel.anu.edu.au>
- References: <1gmgnoINN4bu@sol.deakin.OZ.AU>
- NNTP-Posting-Host: 150.203.5.35
- Originator: markus@octavia
-
-
- In article <1gmgnoINN4bu@sol.deakin.OZ.AU>, rns@deakin.OZ.AU (Robert Sturrock) writes:
- > Hello,
- >
- > 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. Note that my workstation will vary, so I can't just
- > hardwire
- >
- > export DISPLAY=workstation:0.0
- >
- > inside my .bashrc file.
-
- Dunno about bash. The following works for me under (t)csh - I put it
- in the global csh.cshrc file. NB Some programs just check DISPLAY is
- set to see if you are on an X display. Naughty. Leave it to the users
- to decide... :-)
-
- Anyway:
-
- # Take a bash at guessing what to set DISPLAY to..
- set FDISP = `who am i | awk -F\( '{print $2}' | awk -F\) '{printf("%s:0",$1)}'`
- alias setdisp "setenv DISPLAY $FDISP"
-
- Nice and simple. Problems: (i) You have to type 'setdisp' (ii) automatically
- doing it screws users on VT type devices (iii) Some people have
- consoles in their office which they basically use as Xterminals, using another
- machine as their server. If they then (on THAT machine) login somewhere else,
- the above picks up the server rather than their console.
-
- I'm sure there's a nicer way to do it, but "it works for me" (tm) :-)
-
- Markus
-