set "xhost local:" perpetually
I currently do "xhost local:" in a bash shell in my current KDE session to ensure that root apps can access my x session. Where and what should I set to make this a permanent change?
Cheers |
Try putting the command in .bash_profile or .bashrc
|
That's not too much better than what he's doing now. It would be better if you could put it in an .xsession or .xinitrc....
|
dont know if it helps, but you might try this:
create a .profile in your home directory and add the following: export XAUTHORITY=/home/$LOGNAME/.Xauthority export DISPLAY=:0.0 or for all users, (except root!) maybe something like this in /etc/profile if [ ! "`id -u`" = "0" ]; then export XAUTHORITY=/home/$LOGNAME/.Xauthority export DISPLAY=:0.0 fi any help? tobyl edit: I guess this only works if there is only one x session running at any given time |
profile.d
Tobyl,
I should have known that there wouldn't just be an answer but lots of options ... thanks for your suggestion, and thanks to the others too. What I've done is to create a file (chmod'ed to a+x) in /etc/profile.d/ as /etc/profile executes all the scripts in this directory, the script has this in it : #!/bin/bash # Allow local users access to default display unless it's owned by root if [ ! "`id -u`" = "0" ]; then export XAUTHORITY=/home/$LOGNAME/.Xauthority export DISPLAY=:0.0 fi So far I've only spawned a new shell to see if the settings appear in the "export" list. They do and su'ing into root and running konqueror produces the desired result. Thanks. pbhj |
Great, I'm glad you had success.
One thing, though you probably realized anyway, is that many people su to root with 'su -' but for that script to work you want to keep the users env, not inherit root's env, so you are correct to use 'su'. Store some notes somewhere of your modifications, in case one day you have to reinstall, as its a real pain when you can't remember all the little changes you made... tobyl |
Quote:
Also, that's why I chose not to edit profile directly and instead to add a script to profile.d/ easy for backup and upgrade management ... as for little notes, I expect I'll google it!! |
All times are GMT -5. The time now is 05:18 AM. |