Solved

setting DISPLAY

Posted on 1997-04-11
4
217 Views
Last Modified: 2013-12-16
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
Comment
Question by:Bill_West
  • 3
4 Comments
 

Accepted Solution

by:
barnish earned 100 total points
Comment Utility
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
 

Author Comment

by:Bill_West
Comment Utility
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
 

Author Comment

by:Bill_West
Comment Utility
Oops - back again.  Too many search hits to wade through.
Where would I find HPUX RISC, HPUX non-RISC, and
SPARC/Solaris versions?
0
 

Author Comment

by:Bill_West
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now