Torsdag 21 oktober 2004 14:08 kvad Anders Johansson:
On Thursday, 21 October 2004 13.51, Johnny Ernst Nielsen wrote:
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.
Note: Untested
I think this should work for any user other than root, but then root should never be starting X anyway
Unfortunately, as you point out yourself, root must be the user that the system chooses to run the scripts in /etc/ppp/ip-up.d when the IP comes up. So root is the user that must display kdialog on the screen.
USER=`last :0|grep still|awk '{print $1}'` DISPLAY=:0.0 XAUTHORITY=/home/$USER/.Xauthority
Quite right -- it does not work for this situation, since it is not the las logged in user that runs the script.
/opt/kde3/bin/kdialog --msgbox "this is a test"
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
If this works then the user must be root, since that is the only user allowed to write to /root/
I think you are right. Thank you for your effort. :o) Any other ideas? Best regards Johnny :o)