Operating System - HP-UX
1836648 Members
1942 Online
110102 Solutions
New Discussion

Re: Permanent Display variable

 
SOLVED
Go to solution
Kevin_194
Advisor

Permanent Display variable

Would like to know how to change the display variable permanently. Thanks
6 REPLIES 6
Evert Jan van Ramselaar
Valued Contributor
Solution

Re: Permanent Display variable

You could add this to your .profile:

DISPLAY=hostname:0
export DISPLAY
Contrary to popular belief, Unix is userfriendly. It just happens to be selective about who it makes friends with.
Con O'Kelly
Honored Contributor

Re: Permanent Display variable

Hi

The DISPLAY variable is specific to each user ie it's dependent on which system you login from.

If you always login from the same PC/Laptop & it has a fixed IP address then you can set the DISPLAY variable in the .profile in your home directory.

Cheers
Con
Zigor Buruaga
Esteemed Contributor

Re: Permanent Display variable

Hi,

You can add this two lines to your $HOME/.profile

DISPLAY=`who am i -u | cut -c52-`:0
export DISPLAY

Hope this helps.
Regards,
Zigor
Robert-Jan Goossens
Honored Contributor

Re: Permanent Display variable

Hi Kevin,

Add this to your .profile

# -- Do trick to set the display in case of remote login
HOST=`who am i -R |awk '{print $NF}' | sed "s/(\(.*\))/\1/"`
if [ "$HOST" != "" ] && [ "$HOST" != ":0" ] && [ "$HOST" != ":0.0" ];
then
if [ "$HOST" = `who am i -R |awk '{print $NF}' | sed "s/(\(.*\))/\1/"` ]
then
HOST=$HOST:0.0
fi
echo " +--<<"
echo " | Remote login detected, setting DISPLAY to $HOST"
echo " +-->>"
DISPLAY=$HOST
export DISPLAY
fi


Robert-Jan.
Sarvesh A Dhuri
Advisor

Re: Permanent Display variable

Hi !

I guess its depends upon the users PCs IP address . if is having one pc for his work , u can edit his .profile & add export DISPLAY=IP:0.0

where IP address will be users PCs IP address


I have been betrayed by our own People
blal
Frequent Advisor

Re: Permanent Display variable

Hi

U can use the following entry in /etc/profile

export DISPLAY=`who am i -R | cut -c40-52`:0.0

regds,
Baiju

Live and let live.