Mailinglist Archive: opensuse (4020 mails)

< Previous Next >
GUI program in X from script in /etc/ppp/ip-up.d?
  • From: Johnny Ernst Nielsen <johnny.ernst.nielsen@xxxxxxxxxx>
  • Date: Thu, 21 Oct 2004 13:51:08 +0200
  • Message-id: <200410211351.08962.johnny.ernst.nielsen@xxxxxxxxxx>
Good day,

SUSE 9.0

How do I get a GUI program (kdialog) to show on the X screen by a
script in /etc/ppp/ip-up.d?
It has to happen on the screen of whatever user is logged into KDE.

A test script looks like this:

#!/bin/bash

#Test if the script is activated -- write to a file.
echo "Script activated." > /root/test.txt

#See what user the script is started as.
echo "User: $USER" >> /root/test.txt

#See what is in the DISPLAY variable.
echo "Display: $DISPLAY" >> /root/test.txt

#Test if kdialog can be started.
echo "Result of kdialog call:" >> /root/test.txt
/opt/kde3/bin/kdialog --msgbox "This is a test." 2&> /root/
test2.txt

#End of script.

It is the kdialog command that will not work.

Both $USER and $DISPLAY are empty when the script is running, but all,
except the call to kdialog, works as it is supposed to.

kdialog fails with this message:
"kdialog: cannot connect to X server"

So I though that I just needed to give all on the local computer
access to X.

As the user logged in to X I have tried to export the DISPLAY variable
and run xhost +local:
No luck.

xhost +localhost
No luck.

xhost +
(Yes this is dangerous, but for a brief tester...)
No luck.

DISPLAY is set to :0.0
I also tried setting it to localhost:0.0
No luck.

I tried
xhost mycomputer
export DISPLAY=mycomputer:0.0
No luck.

I have not been able to find anything clueful to me in the SDB, the
Sysadmin guide, the User guide, the list archives, or googeling.

I am out of ideas.
Can anyone help?

Best regards
Johnny :o)


< Previous Next >