You are not logged in.

#1 2015-05-23 21:56:51

Xaero252
Member
Registered: 2011-11-28
Posts: 107

DISPLAY environment variable not being set correctly

I just installed Arch on a new machine, installed Mate desktop environment and LightDM for the display manager; upon logging in to the DE the environment variable $DISPLAY is set incorrectly:

 xaero  ~  echo ${DISPLAY}
:0

This causes problems when attempting to start programs using gksu, namely that those applications cannot open the display server. Setting the DISPLAY variable manually rectifies the problem:

DISPLAY=:0.0 gksu someapplication

What can I try to fix the problem permanently, I'd really rather not have to do something hacky like setting DISPLAY in ~/.bashrc.

Offline

#2 2015-05-23 22:41:14

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: DISPLAY environment variable not being set correctly

What exactly is wrong here? What are the error messages and what did you set DISPLAY to to fix it?

Offline

#3 2015-05-24 04:48:28

Xaero252
Member
Registered: 2011-11-28
Posts: 107

Re: DISPLAY environment variable not being set correctly

1.) What's wrong
Currently $DISPLAY only defines the server, not the screen (:0, instead of :0.0 as expected)
2.) How to fix it:
This is nvidia's fault this go around, without defining Screen in Serverlayout the Display environment variable never get's properly set;

Section "ServerLayout"
    Screen      0  "Screen0" 0 0

just adding that second line causes things to go back to normal.

The error messages would be similar to this:

"Unable to open display:" (truncated, just like that)
Anything run using gksu and any applications that depended on the DISPLAY env variable would be broken.

Offline

#4 2015-05-24 22:11:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: DISPLAY environment variable not being set correctly

I installed gksu and run st (my terminal emulator of choice) as root:

[root@b161 karol]# echo $DISPLAY
:0

Seems to work here.

Offline

Board footer

Powered by FluxBB