View previous topic :: View next topic |
Author |
Message |
Aurora l33t
Joined: 26 Sep 2003 Posts: 658 Location: Classified
|
Posted: Wed Sep 06, 2006 10:39 pm Post subject: root DISPLAY not set |
|
|
Man is this annoying...
I used to be able to su - anytime I wanted to run a certain X application as root. I just installed Gentoo on a new system the other day, however, and it doesn't work anymore. Whenever I su into root and I try to start an application, I get this:
Code: | Gtk-WARNING **: cannot open display: |
Now, I fully realize that this means DISPLAY is not set for root, and I have yet to be able to export it and get it to work correctly. Does anyone know why this is happening? Either the DISPLAY variable was set correctly in older versiosn of Gentoo/xorg (maybe the non-modular version?), or maybe I'm just missing something really obvious.
I've seen numerous solutions on this board; some involve editing visudo (telling it to export DISPLAY automatically) and using sudo instead of "su", others involve editing pam configuration files. Both seem unnecessary, especially considering it used to work fine in the past without any extra work.
Why isn't DISPLAY set correctly and automatically? Thoughts/ideas on how to resolve this permanently?
Thanks! _________________ "My downfall raises me to infinite heights." -Napoleon Bonaparte |
|
Back to top |
|
|
dmitchell Veteran
Joined: 17 May 2003 Posts: 1159 Location: Austin, Texas
|
Posted: Thu Sep 07, 2006 12:03 am Post subject: |
|
|
I think the problem is XAUTHORITY, not DISPLAY. Add the following to ~/.bashrc and run 'source ~/.bashrc'. The startx script sets XAUTHORITY automatically; if you previously used startx but now use [gkx]dm, that would explain the change in behavior. I don't know how this will interact (if at all) with SSH, which automatically sets XAUTHORITY when you login.
Code: | [[ -f ~/.Xauthority ]] && export XAUTHORITY=~/.Xauthority |
_________________ Your argument is invalid. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|