X programs from terminal

Discuss Applications

X programs from terminal

Postby Master of Reality » Fri Feb 21, 2003 4:46 pm

whenever i try to run an X program from terminal (openoffice installer to be exact) it says it cant connect to Xserver. I did "xhost +" to take off access restrictions completely, but it still doenst work. I am using Slackware, on konsole and "su -"'d as root.
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby Void Main » Fri Feb 21, 2003 6:18 pm

What is your DISPLAY variable set to?

$ echo $DISPLAY
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Master of Reality » Fri Feb 21, 2003 11:32 pm

:0.0
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby Void Main » Sat Feb 22, 2003 1:23 am

I actually meant, what is the DISPLAY variable set to after you "su -":

# echo $DISPLAY

but after doing a quick search it appears to be slightly more complicated in Slackware:

http://free.house.cx/~eil/slackwarenotes.html

Running X apps as root on a user's display
By default, root does not have the authority to start a client on someone else's X session. If such capability is needed, the following simple instructions will allow it. This method depends on there being only one regular user of the system (the one running the X session).

As root, cd to ~ and do:

rm ~/.Xauthority
ln -s ~user/.Xauthority

where user is the name of the user with the X session. Next, determine what display the session is using. To find out, enter:

echo $DISPLAY

as the user. Usually this will be :0.0. Put the environment variable and its value into root's .bash_profile and you're all set.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Master of Reality » Sun Feb 23, 2003 1:44 pm

erm... i cant edit the .bash_profile to "Put the environment variable and its value into root's .bash_profile" because i dont have a .bash_profile
...what should i do?
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby Void Main » Sun Feb 23, 2003 1:54 pm

Create one. Or add it to root's .bashrc.
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Master of Reality » Sun Feb 23, 2003 9:18 pm

dont have a .bashrc

what should be in these files?
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby Void Main » Sun Feb 23, 2003 10:54 pm

Create one, "man bash".
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Master of Reality » Mon Feb 24, 2003 4:33 pm

i got the bashrc and bash_profile (copied from redhat... doesnt seem to have any special settings in it so it should be okay)... but what does it mean "Put the environment variable and its value into root's .bash_profile and you're all set"?
Master of Reality
guru
guru
 
Posts: 562
Joined: Thu Jan 09, 2003 8:25 pm

Postby Void Main » Mon Feb 24, 2003 4:35 pm

It basically means put this in:

export DISPLAY=:0.0
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA


Return to Applications

Who is online

Users browsing this forum: No registered users and 1 guest

cron