[Gllug] export DISPLAY in .bashrc

SteveC steve at fractalus.com
Thu Jun 17 13:16:07 UTC 2004


* Daniel P. Berrange (dan at berrange.com) wrote:
> On Thu, Jun 17, 2004 at 02:15:39PM +0100, Richard Jones wrote:
> > On Thu, Jun 17, 2004 at 01:56:22PM +0100, SteveC wrote:
> > > I've been googling around for how to set the display upon login.
> > > 
> > > Basically I have someone who uses $BIZARRE_X_SERVER_FOR_WINDOWS and
> > > ssh's to a box with putty. I'd like bashrc to set the display to the ip
> > > address they log in from if they do so remotely and otherwise leave it
> > > alone.
> > 
> > On my machine at home, ssh sets various SSH_* variables which appear
> > to contain the client IP address:
> > 
> > $ printenv | grep SSH
> > SSH_CLIENT=10.0.0.249 58543 22
> > SSH_TTY=/dev/pts/1
> > SSH_CONNECTION=10.0.0.249 58543 10.0.0.252 22
> > 
> > In particular, SSH_CONNECTION looks useful.
> 
> Putty only sets SSH_CLIENT and SSH_TTY, but that should be 
> sufficient.

export DISPLAY = cut -d ' ' -f 1 < echo $SSH_CLIENT
export DISPLAY=$DISPLAY:0

or something should work?

> Dan.
> -- 
> |=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
> |=-       Perl modules: http://search.cpan.org/~danberr/              -=|
> |=-           Projects: http://freshmeat.net/~danielpb/               -=|
> |=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|


have fun,

SteveC steve at fractalus.com http://www.fractalus.com/steve/
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list