Peter O'Gorman wrote:
On 12/10/2009 06:39 PM, Mike Pfaiffer wrote:
It seems zenity won't display if a different user is logged in. For
example running it as a single line from /etc/rc.local won't bring up a popup. It may not have worked well with at either. Does anyone have a suggestion which works well with at and can be called from /etc/rc.local? I have everything else working for the public access box. Just not the notification. I figure we can leave the notification routing for a week and just post a note.
Is it not working because DISPLAY is unset, or some other reason?
Try adding --display=:0.0 to the zenity arguments.
That did the trick. Thank you. The cool thing is because rc.local is executed as soon as it goes into mode 5 the message and shut down occur regardless. Even if nobody logsin or if they logout and login again. The only way around it is to reboot. That is so obvious other people will notice. Plus it does pretty much the same thing we wanted anyway.
I'm sure this will be of no interest to the "*NIX heavyweights" of the group. For everybody else here is the code I plan to add to the machine...
***** rm -rf /home/guest cp /root/guest.tar /home cd /home tar -xvf guest.tar rm guest.tar cd - echo 'zenity --info --display=:0.0 --text="This computer will automatically turn off in five minutes." --width=150' | at now +25 minutes echo 'shutdown -h now' | at now +30 minutes *****
This presumes a pre-existing guest account which has had its home directory tarred to guest.tar. Then the tar file is stored in the (inaccessible to unprivileged users) /root directory.
Incidentally the zenity line is all one line. the line before uses the dash/minus sign to return to the previous directory.
I may also have to tweak the width a little.
Peter
Thanks again everybody.
Later Mike