1. DISPLAY env var is not defined.
2. No authorization.
I could turn around this by:
1. Defining DISPLAY=:0 (for :0 vt)
2. xauth merge /home/<normal_user>/.Xauthority
Is there a better way?
I could put "xauth merge /home/<normal_user>/.Xauthority"
in .bashrc. But what about DISPLAY?
Thanks for any help
You should run X applications as root as little as possible, and the extra
work required to get X apps to run as root is a good discouragement of the
practice.
You could set the DISPLAY variable in .bashrc as well as do the xauth
merge, but I would put those command into a separate script.
Typically, I don't bother with the xauth stuff; instead I do this:
useraccount$ xhost +local:
root# export DISPLAY=:0.0
The command "xhost +local:" allows any programs on your machine to contact
the X server.
I haven't created a script to do this. I just type the commands into the
terminal window because it isn't often that I run X apps as root.