Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-08-2006, 03:22 PM
|
#1
|
Member
Registered: Dec 2002
Location: UK
Distribution: Slackware 12; Ubuntu 7.10
Posts: 358
Rep:
|
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
|
|
|
05-08-2006, 06:26 PM
|
#2
|
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467
Rep:
|
Try putting the command in .bash_profile or .bashrc
|
|
|
05-09-2006, 09:41 AM
|
#3
|
Senior Member
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914
Rep:
|
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....
|
|
|
05-09-2006, 02:21 PM
|
#4
|
Member
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 769
Rep:
|
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
Last edited by tobyl; 05-09-2006 at 02:27 PM.
|
|
|
05-09-2006, 05:08 PM
|
#5
|
Member
Registered: Dec 2002
Location: UK
Distribution: Slackware 12; Ubuntu 7.10
Posts: 358
Original Poster
Rep:
|
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
|
|
|
05-09-2006, 05:45 PM
|
#6
|
Member
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 769
Rep:
|
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
|
|
|
05-09-2006, 06:41 PM
|
#7
|
Member
Registered: Dec 2002
Location: UK
Distribution: Slackware 12; Ubuntu 7.10
Posts: 358
Original Poster
Rep:
|
Quote:
Originally Posted by tobyl
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...
|
That's why I "su", I like to keep my env.
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 09:20 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|