You are not logged in.

#1 2008-03-13 09:24:05

paulfxh
Member
Registered: 2008-03-11
Posts: 33

[Solved] Automate connection to x-server as root?

I use kwrite as my preferred editor.
However, when I need to use it as root and open it from a terminal, I get an error message stating that a connection cannot be made to the x-server.
I can overcome this by typing

# cp /home/<user>/.Xauthority /root

and then kwrite (and others such as kate) open readily as root.
However, I have to do this EVERY time I boot into Arch.
Other than writing an executable script and putting it into ~/.kde/Autostart, is there any way I can make this automatic?

Last edited by paulfxh (2008-03-13 20:18:59)

Offline

#2 2008-03-13 11:54:20

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: [Solved] Automate connection to x-server as root?

Many alternatives. Safest is to just use kdesu.

kdesu name-of-app

or sudo

sudo name-of-app

You could also edit /etc/profile and add this


export XAUTHORITY=/home/usersname/.Xauthority

Offline

#3 2008-03-13 12:03:41

paulfxh
Member
Registered: 2008-03-11
Posts: 33

Re: [Solved] Automate connection to x-server as root?

Perfect!
Thank you

Offline

#4 2008-03-13 12:34:23

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: [Solved] Automate connection to x-server as root?

NP. Please remember to mark your thread as [SOLVED]. wink

Since this is a frequently asked question, I created a wiki page for it.
http://wiki.archlinux.org/index.php/Run … ps_as_root

Offline

Board footer

Powered by FluxBB