Re: [ilugd] Automatically setting display.. A roadblock
-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/
Re: [ilugd] Automatically setting display.. A roadblock
On Tue, Sep 23, 2008 at 3:58 PM, Ashish Shukla आशीष शुक्ल [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 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). ssh? I am not using ssh. The box I am logging onto is via rsh. For ssh its simple, no DISPLAY nonsense, just do ssh -X and it works And what if you're logged-in at :1 and want to work at :0, hmm...? Nope, I don't want to do that. All I want is this Suppose I do a startx -- :1 on alpha My X server starts I open xterm and do a rsh -l username beta When I login on beta, my display should be automatically set to alpha:1 ___ 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/
Re: [ilugd] Automatically setting display.. A roadblock
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tanveer Singh writes: [snip] ssh? I am not using ssh. The box I am logging onto is via rsh. For ssh its simple, no DISPLAY nonsense, just do ssh -X and it works And what if you're logged-in at :1 and want to work at :0, hmm...? Nope, I don't want to do that. All I want is this Suppose I do a startx -- :1 on alpha My X server starts I open xterm and do a rsh -l username beta When I login on beta, my display should be automatically set to alpha:1 I've never used rsh(1), and from a glance on its manpage, I don't think it supports exporting environment variables, so the only thing you can do is to probably invoke a script (a wrapper script around your shell which also exports the desired $DISPLAY to the shell) on your login to the server. 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) iEYEARECAAYFAkjYy3EACgkQHy+EEHYuXnSeJQCgtIIr5v9Si7NJEdpnbJdk71zl RqsAn0ZQup7uiykBAbBApHc078FiecTT =5Dq0 -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/