Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!munnari.oz.au!mel.dit.csiro.au!yarra!bacchus!matt From: matt@bacchus.esa.oz (Matthew Atterbury) Newsgroups: comp.windows.x Subject: Re: X-windows DISPLAY environment variable Keywords: DISPLAY Message-ID: <674@bacchus.esa.oz> Date: 3 Jul 90 23:44:39 GMT References: <331@ge1cbx.UUCP> Organization: none Lines: 21 Reply-To: In article <331@ge1cbx.UUCP> gerald@ge1cbx.UUCP (Gerald Aden) writes: >I am trying to figure out a way to automatically resolve >and set the DISPLAY environment variable when someone logs Dunno about your system, or TELNET, but a `who` gives: matt ttyp3 Jul 4 09:14 (thomas:0.0) henry display Jul 4 07:37 The (thomas:0.0) says that I'm rlogin'd from thomas. On my 'own' system, it doesn't list me coz of xdm not updating the /etc/utmp file (rickin' nickin' rackin' %$%!$%). Use `tty` to work out which line in `who` "you" are (if any), then see if `who` tells you the host or display name & extract it for setting DISPLAY (this doesn't work perfectly for rlogins from the second or subsequent screens, though this setup is not common?). Use ":0" if no host given. I leave the shell script for this to the reader. :-) -- ------------------------------------------------------------------------------- Matt Atterbury [matt@bacchus.esa.oz.au] Expert Solutions Australia, Melbourne UUCP: ...!uunet!munnari!matt@bacchus.esa.oz.au "klaatu barada nikto" ARPA: matt%bacchus.esa.oz.AU@uunet.UU.NET "life? don't talk to me about life!"