[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Using setenv DISPLAY



I'm running sarge, logged in as user using text log in and then
startx. For no apparent reason, I could no longer use sudo to start
gtk apps without "cannot open display error".

I start by checking what my DISPLAY value is, but encountered an
anomaly:  

  $ echo $DISPLAY
  :0.0

  $ sudo echo $DISPLAY
  :0.0

That seemed OK, but when I did:

  $ env | grep DISPLAY. 
  DISPLAY=:0.0

  $ sudo env | grep DISPLAY
  [nothing returned]
	
Why do I get inconsistent results? In the first case, the value of
DISPLAY is known, but in the second when I use env, it is not found in
the environment accessed by sudo.

At least something is wrong, so I set out to do (teufel is the host
name):  

  # sudo setenv DISPLAY teufel:0

but I get the error, "command not found". Shouldn't it be accessible
from a bash prompt when using sudo?

I suppose I could also do:

  $ sudo export DISPLAY=`teufel`:0.0
  
but wanted to clear up the previous questions first. 

Am I correct to assume that the host name is optional when using
either setenv or export? Is it true that setenv command should not be
supplied the screen number "0", but that export must have it, as in my 
examples above? 

-- 
 
       Haines Brown
       KB1GRM       



Reply to: