[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Connect to local X server?

From: Bruce Edge
Subject: Connect to local X server?
Date: Sat, 11 Sep 2010 09:55:22 -0700

> Today's Topics:
>   1. Connect to local X server? (Shawn Young)
> ----------------------------------------------------------------------
> Message: 1
> Date: Fri, 10 Sep 2010 15:18:14 -0600
> From: Shawn Young <address@hidden>
> Subject: Connect to local X server?
> To: address@hidden
> Message-ID:
>        <address@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
> Hi,
> I am sorry for bothering you with what is probably a simple question but I
> am not creative enough to come up with the proper search keywords when I've
> tried searching this on the screen-users' website or on google.  Whenever I
> try to pull up an application which requires X when I am using screen I get
> an error telling me that I can't connect to the local X server.  This isn't
> a problem on a different machine that I have, in fact, using that machine I
> can log into the machine with a problem, start a screen session and pull up
> X applications.  What should I look for on the machine with problems that
> will fix my problem?
> Thanks,
> Shawn
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: 
> ------------------------------
> _______________________________________________
> screen-users mailing list
> address@hidden
> End of screen-users Digest, Vol 1089, Issue 1
> *******************************************

I use a couple of scripts for this.

One, xenvsave, I use from any terminal with the correct X settings,
the other, an alias, xenvload I use from terminals that need their env
The xenvload create host specific .ssh.env files in my home and the
xenvload simply sources them.
Here's the details;

0 %> cat ~/bin/xenvsave


# Copy X env into a file that can be sourced from another shell.
echo "set -a" >$file
env | grep -e SSH -e DISPLAY | grep -v TTY | sed -e 's/=\(.\+\)/="\1"/' >>$file
echo "set +a" >>$file

alias xenvload=". ~/.ssh.env.$(hostname)"

I'm sure someone has a cleaner option, but this works pretty well in
an env of many servers and X sessions.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]