[QCLUG] Re: Kid timer

Steve Langasek vorlon@dodds.net
Mon, 17 Jul 2006 14:10:59 -0700


On Mon, Jul 17, 2006 at 03:26:37PM -0500, Leif Theden wrote:
> if you want a graphical dialog to warn the user that the computer will
> shutdown, add this to the kid's startup script (~/.xinitrc):
> xhost +hostname   (where hostname=the computer's name)

Except never do this.  xhost should be considered deprecated for all
purposes.

Instead, root can abuse its privileges to call:

  DISPLAY=:0 XAUTHORITY=/var/lib/gdm/\:0.Xauth \
     zenity --info --text='computer will shutdown in 5 minutes'

But that doesn't seem like it should be necessary either.  When shutdown
sends its message, it blasts it to all open terminals, both ttys and ptys.
There should be a suitable tool that connects to X and listens on a pty for
any events, popping up a window when this happens.  But as I don't know
off-hand what this is, zenity should work just as well...

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
vorlon@debian.org                                   http://www.debian.org/