LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to run GUI program as root (https://www.linuxquestions.org/questions/slackware-14/how-to-run-gui-program-as-root-364749/)

shadkong 09-19-2005 02:20 AM

How to run GUI program as root
 
In Slackware 10.1, I do it as follow:
$ xhost +<host name>
$ su
# <run it>
But now in Slackware 10.2, I found this way does not work, it says: cannot connect to xxx server. Who can tell me why?
Thanks!

tkedwards 09-19-2005 02:22 AM

I'm not sure why that's broken but assuming you're using KDE you can just run:
Code:

kdesu command
You can do the same thing by going menu->Run Command and under 'Options' setting 'Run as a different user'

shadkong 09-19-2005 02:27 AM

I use KDE, but the GUI program that I want to run is not a KDE program, will it work?

davidsrsb 09-19-2005 02:39 AM

Just tried it and the answer is YES.
Ethereal is one example of a gui program that needs root rights.

shadkong 09-19-2005 04:28 AM

Yes, it works!
But if I don't use KDE, will it work? If not, what can I do?

tkedwards 09-19-2005 04:47 AM

Quote:

But if I don't use KDE, will it work?
Yes it will work as long as you have KDE installed - I just tried it then in GNOME.

Also have you tried:
Code:

su -
<run application>

It works on my system (Mandriva 2005LE). The - option means to create a login shell, ie. a shell with all the environment variables set as though you'd logged in as root.

shadkong 09-19-2005 11:55 PM

Quote:

Originally posted by tkedwards
Also have you tried:
Code:

su -
<run application>

It works on my system (Mandriva 2005LE). The - option means to create a login shell, ie. a shell with all the environment variables set as though you'd logged in as root.

When I use Red Hat 7.2 and Red Hat 9, this method used to work, but it doesn't work in Slackware.

Vgui 09-20-2005 12:08 AM

Hmm, what window manager are you running? If I do a "su root" it allows me to run X applications. Maybe try "su -c command".

EDIT: This is using Windowmaker 0.9.2 and Slackware 10.2 btw.

maginotjr 09-20-2005 03:24 PM

here I can run any app with any user just login the user in the terminal and them typing the app I want to run.

You can open GTK app on KDE if you have the GTK libraries and KDE app on Gnome if you have the QT libraries, is just a matter of the right libs and files.

if I type:
$su
#./runLime.sh

it runs on KDE without problems

or even
$su
#kview

it runs on Gnome without noproblems too ...

or I can just short the command line with a
$su -c "kview"

[ ]īs


All times are GMT -5. The time now is 04:44 AM.