Reputation: 133
Greetings!
I am implementing a backup solution, and I need to access the X11 display for getting a password from the user and displaying status information. I have tried setting $DISPLAY in the script to :0.0 (hardcoded), but xhost and misc complain that they cannot open the display. What should I do?
PS: The script is here: http://dpaste.com/109435/
Upvotes: 5
Views: 4191
Reputation: 54325
You need the X Authentication information. I do not believe that xhost
can "break in" to an X session and allow access without it (you'd need to have the user do it for you) and if you have it, then there is no need to use xhost at all.
Try
export DISPLAY=:0.0
export XAUTHORITY=/home/user/.Xauthority
and then running your commands.
Upvotes: 6
Reputation: 133
Thanks, you brought me on the right path. Now I execute xhost +local: in my .xinitrc, and that allows me to access the X11 display (when I export DISPLAY).
Upvotes: 1
Reputation: 37103
As stated above, the user has to allow you to access their display. They need to perform the xhost + command. It's not really a good idea to just open your display up to anyone!
You'd be better off getting them to run
xhost +jeeger
or whatever your user is running as.
HTH
cheers,
Rob
Upvotes: 1