• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

setting DISPLAY

Is there a way for a .login/.profile/.*shrc to autmatically
assign $DISPLAY so that X-windows go to the original login
monitor?  When answering, consider that I have already seen
four solutions and each has one of the following flaws:
1. Not portable to all Unices.
2. Hard-coded to the user's "usual" host.
3. In the case of chained rlogins, doesn't get all the way
   back to the original host; picks a machine in between.
4. Works usually, but depends on the format of something
   like 'ps' or 'who' or 'w', etc. and screws up when
   the output format varies (which happens sometimes).
0
Bill_West
Asked:
Bill_West
  • 3
1 Solution
 
barnishCommented:
Have you thought of using xrsh rather than rlogin.
This command sets the DISPLAY variable for you as you login, and thus works along chained rlogins. There is a version available for all Unices and it works from any host.
Thus this solution satisfies those flaws in other solutions.

The only problem is this solution will bring up a new window for each new login...

0
 
Bill_WestAuthor Commented:
Well, bringing up a new window each time is a slight
disadvantage, but the fact that it's consistent makes it
better than everything I've tried so far.  I'll try it
before I score it, but it sounds good.....
0
 
Bill_WestAuthor Commented:
Oops - back again.  Too many search hits to wade through.
Where would I find HPUX RISC, HPUX non-RISC, and
SPARC/Solaris versions?
0
 
Bill_WestAuthor Commented:
Never mind, I tracked it down.  Looks good, and
since it's a script, portability is OK.

I was going to score this 'C' due to the drawback of
getting a new window on every hop, and also the
disadvantage that it doesn't work unless you use it
exclusively, e.g., if I login to mercury, rlogin to
venus, from there xrsh to saturn, and on saturn invoke
'the_X_tool_from_hell' I will either get an X error
or nothing at all.  

However, since xrsh and xrlogin are scripts, I can
'borrow' the mechanism they use to transfer $XHOST
and $DISPLAY and build it into my .profile (or
equivalent). This lets me raise the score to 'B'.  
A 'plug-n-play' answer would have scored an 'A' (if
it worked).

Thanks!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now