Operating System - HP-UX
1837512 Members
3634 Online
110117 Solutions
New Discussion

Re: i want to know,why DISPLAY must to :hostname:0.0?

 
SOLVED
Go to solution
常有慈悲心
Regular Advisor

i want to know,why DISPLAY must to :hostname:0.0?

what's mean of 0.0?
is there any other usage?
like: hostname:0.1
hostname:1.0 ....or anything else?
3 REPLIES 3
Fred Ruffet
Honored Contributor
Solution

Re: i want to know,why DISPLAY must to :hostname:0.0?

Hi !

Display is set up as hostname:display.screen. It must be set like this because it's the way X-Window understands it.

hostname can be your IP or every name or alias it is resolved as on network.

display is the number of the X server you're connected at. You can configure your X server to be launched with a different number. It is usefull when running multiple X servers on 1 machine.

screen can be something else than 0 if you have more than 1 screen on your machine. If you have 2 graphical cards in your machine and put a screen on each, you can configure X to use both. Then you'll have :0.0 and :0.1.

regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Steven E. Protter
Exalted Contributor

Re: i want to know,why DISPLAY must to :hostname:0.0?

Here is code that might help in /etc/profile

DISPLAY=$(who -m -u | awk '{print $8}'):0.0
export DISPLAY


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Fred Ruffet
Honored Contributor

Re: i want to know,why DISPLAY must to :hostname:0.0?

If you're connected from CDE (or any other WM), your :display.screen is already displayed in "who" :
/>who -mu
root pts/0 Jul 26 18:51 . 11139 10.33.200.14:0.0

so I would use this :

DISPLAY=$(echo $(who -m -u | awk '{print $NF}' | cut -d ":" -f 1):0.0 | cut -d ":" -f 1,2)

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)