-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tanveer Singh writes:
> I used to have this in my .cshrc
> set DISP = `who am i | sed -e "s/(//" -e "s/)//" | awk '{printf "%s",$6}'`
> setenv DISPLAY {$DISP}:0.0

> This works as long as I am on X server 0
> So my local machine is alpha and I login to beta, I would have a
> DISPLAY set to alpha:0

I think this will be insecure, unless you're using XAUTH and other form
of ACLs provided by X, and X11 Forwarding via OpenSSH is the recommended
way to do this in my opinion, where you don't need such ugly hacks :D
. For more information, RTFM ssh(1).

> The problem is what if my local machine X was started with startx --
> :1 and not startx
> Then also it would set it to alpha:0, though the correct usage would be 
> alpha:1
> Is there a way of automatically doing that?

And what if you're logged-in at :1 and want to work at :0, hmm...? There
is nothing like correct here, probably you've to specify some kind of
logic, on why you want to work on :1, when you can work on :0.

The directory '/tmp/.X11-unix' contains the sockets to all the X servers
running at any instant on a host. So maybe you would like to hack a
shell script to enumerate between those sockets and figure out yourself,
which $DISPLAY you want to connect to :) .

Ashish
- -- 
()  ascii ribbon campaign - against HTML e-mail
/\  www.asciiribbon.org   - against proprietary attachments
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
% dig +short cname cdac.in @::1
ms.gov.in
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAkjYxNwACgkQHy+EEHYuXnTH0wCgvEkbZl5Ls0oEkZ+PXngAzHtl
P1IAn1Nn6TGAaXxw0BIPb74B4XiHedGv
=yj8b
-----END PGP SIGNATURE-----

_______________________________________________
ilugd mailinglist -- ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/ilugd@lists.linux-delhi.org/

Reply via email to