Sebastian Padó hat gesagt: // Sebastian Padó wrote: > 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 use a little script at all my home machines that you may like, too. The trick is: The Xserver is running as root anyway, so if you can get the xserver to run the shutdown command, there is no need to mess with sudo etc. The script inserts two littles buttons in the xdm-screen: One for shutting down, one for reboot. Installation is simple. Put the attached tkmgr-script in /usr/local/bin You have to edit two config files. First put the following at the end of "/etc/X11/xdm/Xsetup_0" # ---- snip Xsetup_0 -- # Starting the shutdownmanager: /usr/local/bin/tkmgr & echo $! > /var/run/tkmgr-pid # ---- snip ----------- Then put this in "/etc/X11/xdm/Xstartup_0": # ---- snip Xstartup_0 -- # :0 specific startup commands go here # Kill the Shutdownmanager: if [ -f /var/run/tkmgr-pid ] then kill `cat /var/run/tkmgr-pid` rm -f /var/run/tkmgr-pid fi # ---- snip -- That's it. bye -- __ __ Frank Barknecht ____ ______ ____ __ trip\ \ / /wire ______ / __// __ /__/ __// // __ \ \/ / __ \\ ___\ / / / ____/ / / / // ____// /\ \\ ___\\____ \ /_/ /_____/ /_/ /_//_____// / \ \\_____\\_____\ /_/ \_\
#!/usr/bin/wishx # Init stuff wm title . Chooser wm protocol . WM_DELETE_WINDOW Quit # Ganz unten wm geometry . +1-1 # The buttons frame .buttons button .buttons.reboot \ -text "System neu starten" \ -width 19 \ -command Reboot button .buttons.halt \ -text "System runterfahren" \ -width 19 \ -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 & }