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 USER=`last :0|grep still|awk '{print $1}'` DISPLAY=:0.0 XAUTHORITY=/home/$USER/.Xauthority /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/