LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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



Reply
 
Search this Thread
Old 12-08-2003, 01:56 AM   #1
ganninu
Member
 
Registered: Jul 2003
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340

Rep: Reputation: 30
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
 
Old 12-08-2003, 03:13 AM   #2
TheSpork
Member
 
Registered: May 2003
Location: Norway
Distribution: Ubuntu / Debian
Posts: 40

Rep: Reputation: 15
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..
 
Old 12-08-2003, 05:03 AM   #3
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
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
 
Old 12-08-2003, 07:21 AM   #4
ganninu
Member
 
Registered: Jul 2003
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: Reputation: 30
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
 
Old 12-08-2003, 10:25 AM   #5
ganninu
Member
 
Registered: Jul 2003
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: Reputation: 30
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??
 
Old 12-09-2003, 01:39 PM   #6
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
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.
 
Old 12-11-2003, 03:37 PM   #7
TheSpork
Member
 
Registered: May 2003
Location: Norway
Distribution: Ubuntu / Debian
Posts: 40

Rep: Reputation: 15
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..
 
Old 12-11-2003, 05:08 PM   #8
ganninu
Member
 
Registered: Jul 2003
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: Reputation: 30
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.
 
Old 01-16-2004, 02:24 PM   #9
Oliver Low
LQ Newbie
 
Registered: Jan 2004
Location: Northamptonshire, England
Distribution: SuSE and Debian
Posts: 10

Rep: Reputation: 0
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
 
Old 01-17-2004, 07:29 AM   #10
ganninu
Member
 
Registered: Jul 2003
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: Reputation: 30
thanks a bunch! that really rocks... 'kdesu xterm' is just enough - it prompts me for the root password if the application needs root privileges.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Konsole and other applications Kroenecker Fedora 5 07-28-2005 01:29 PM
Running Applications kingtas Linux - Newbie 3 09-13-2004 05:31 PM
Running konsole from Gnome... Lechium Linux - Software 2 08-05-2004 11:49 AM
running apps from a konsole without it being dependent DropSig Linux - Newbie 4 06-07-2004 06:53 PM
Mutex fails when running Kedit from Konsole misfit-x Linux - General 0 01-16-2004 11:18 AM


All times are GMT -5. The time now is 07:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration