[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Halt / Reboot: other user



On Sun, 29 Oct 2000, Sebastian Padó wrote:

> Hi all,
> 
> I run xdm as my x login manager and I would like to
> be able to reboot and halt from it (like kdm allows it).

I've created the script /usr/local/sbin/tkmgr:

#!/usr/bin/wishx

# Init stuff
wm title . Chooser
wm protocol . WM_DELETE_WINDOW Quit

# Ganz unten
wm geometry . -0-0

# The buttons
frame .buttons
button .buttons.reboot \
        -text "Reboot" \
        -width 10 \
        -command Reboot
button .buttons.halt \
        -text "Halt" \
        -width 10 \
        -command Halt
pack append .buttons \
        .buttons.halt   {left expand fill} \
        .buttons.reboot {left expand fill}

pack .buttons -side top -fill x -expand true

# The Functions
proc Quit {} {
    exit 0
}

proc Reboot {} {
    exec /sbin/shutdown -rt 15 now < /dev/tty1 > /dev/tty1 2> /dev/tty1 &
}

proc Halt {} {
    exec /sbin/shutdown -ht 15 now < /dev/tty1 > /dev/tty1 2> /dev/tty1 &
}


Then I've added to the /etc/X11/xdm/Xsetup_0 file the line 

/usr/local/sbin/tkmgr &

And to the /etc/X11/xdm/Xstartup_0

killall tkmgr

That works, needs some package providing a wishx, for example wishx8.0.4

Martin

-- 
Linux - the last service pack you'll ever need.

For public GnuPG-key: finger fluch@vesuri.helsinki.fi



Reply to: