LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Running X applications from the Konsole (under KDE) (https://www.linuxquestions.org/questions/linux-general-1/running-x-applications-from-the-konsole-under-kde-123770/)

ganninu 12-08-2003 12:56 AM

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).

thanks, ganninu

TheSpork 12-08-2003 02:13 AM

Run the command

echo $DISPLAY

and if you get an empty string back, run

export DISPLAY=localhost:0.0

or

export DISPLAY=<ip-address>:0.0

if you are exporting to a specific IP-address..


After doing that, you might have to run

xhost + (to allow all IP-addresses) or

xhost +<IP-address>

to allow certain IP-addresses to "connect" to your screen; i.e.

xhost +localhost

if it is your own computer..


Hope it helps!

PS. do not write any of the < or > around IP-addresses..

LinuxLala 12-08-2003 04:03 AM

if i understand correctly, u just dont want to search for the program in the K menu.

Just press Alt+F2 and type the name of the application u want to run.

eg: evolution, kppp

Works perfectly :D

ganninu 12-08-2003 06:21 AM

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...

Ganninu

ganninu 12-08-2003 09:25 AM

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??

LinuxLala 12-09-2003 12:39 PM

i did not know such was the case with debian. I use RedHat and i thought that all distros would prompt for a root passwd.

TheSpork 12-11-2003 02:37 PM

Quote:

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...

Let me know if that doesn't work..

ganninu 12-11-2003 04:08 PM

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.

ganninu.

Oliver Low 01-16-2004 01:24 PM

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.

Oliver
:)

ganninu 01-17-2004 06:29 AM

thanks a bunch! that really rocks... 'kdesu xterm' is just enough - it prompts me for the root password if the application needs root privileges.


All times are GMT -5. The time now is 06:15 AM.