[Gllug] automagic DISPLAYs

robin.c.smith at bt.com robin.c.smith at bt.com
Tue Sep 18 12:02:23 UTC 2001


In your bash profile you can write a simple script to determine where you
came in from and to set the DISPLAY.

Clues:- Use "who" to see the hostname or IP addresses of who is logged in
and use "tty" to determine which of the "who" you are.

so:-

TTY=$(tty|sed -e 's:/dev/::')
DISPLAY=$(who | grep ${TTY} | sed -e 's/^.*(//' -e 's/).*//')

You may want to add a :0 to the end of the DISPLAY

Robin

-----Original Message-----
From: Simon Trimmer [mailto:simon at urbanmyth.org]
Sent: 18 September 2001 11:34
To: gllug
Subject: [Gllug] automagic DISPLAYs


Hi All,
A question, someone must have tried this before...

I want to get the DISPLAY environment variable set to the hostname from
which I logged in from, anyone think of a reliable method?

Don't suggest ssh X redirection, machines have no X libraries :)

-Simon
Simon Trimmer <simon at urbanmyth.org>


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list