Running X applications from the Konsole (under KDE)
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
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.
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Rep:
Running X applications from the Konsole (under KDE)
I often install new programs, and although I'm on KDE/gnome, when i try to launch them from the Konsole, I'll get the following error:
/home/ganninu# <some X-Application>
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
Gtk-WARNING **: cannot open display: :0.0
Of course, when I launch the program from the K-Menu, it launches correctly. But it's a bit daunty of having to "find" the program atthe K-Menu... Is there a quick way to still launch the application from the Konsole directly (Konsole = Terminal of KDE, not the text only mode Linux).
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Original Poster
Rep:
i have had already tried that as well ) Doesn't work for my case because it requiers to be root, but unfortunately the program doesn't ask me for my root password, so i need to log in as root.
As regards to TheSpork's suggestion, I still get that error...
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Original Poster
Rep:
The bad thing is that if an application requires root privileges, alt-F2 still doesn't help... i need to log off and then login as root to run the application... This is my current situation on Debian.. On redhat i used to be prompted by the root password... do i need to pass some arguments to the executable??
Originally posted by ganninu The bad thing is that if an application requires root privileges, alt-F2 still doesn't help... i need to log off and then login as root to run the application... This is my current situation on Debian.. On redhat i used to be prompted by the root password... do i need to pass some arguments to the executable??
You can try by running
su -c command
That will prompt you for the root-password, execute the given command, and then go back to the users shell..
I tested it with Debian Sarge (testing) using the console in Blackbox.. I guess it would work for executing graphical tools too, but I haven't tested it...
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Original Poster
Rep:
nope it doesn't work. and i discovered why - strangely, the X-session is owned by root, so i need to be logged in as root to make it work - logging in as a normal user and then su, won't work neither. I had to merge the .Xauthority file to make it work. Mind you, everytime i restart the x-xerver i have to merge this file.
KDE launches root privilege X-apps using kdesu (c.f. the menu items for YaST).
e.g.
kdesu --nonewdcop -- /sbin/yast2
which is what prompts you for the root password.
The thing is that by default, other users cannot attach to your X-server (even root).
if you are root and want to run an x-app as another user in KDE use the -u switch
e.g.
kdesu -u oliver xterm
(-u not -l like su)
use -c to execute a single command
Obviously it does not prompt for the oliver's password if you are root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.