Simple Xlib control panel for shutting down, rebooting, suspending or
hibernating the system.
XDM is an OK Display Manager, but unlike other display managers it
doesn't have controls to shutdown or reboot the computer. You need to
log in, then use your Desktop Environment or Window Managers shutdown
options.
I wanted to use XDM on my old laptop, but wanted to add the ability to
shutdown from the login screen. There are two ways to do this.
Firstly, modify the XDM source code itself, secondly, run another
program which gives the user those options. The first is neater, but
a bit of a hassle if you use your distributions package manager to
install xdm. The second option is a little messier, but works.
This program adds a button to shutdown, reboot, suspend and hibernate.
To use this, add the following two likes to the Xstartup file in the xdm configuration directory.
pid=$(cat /var/run/xdmshutdown.pid 2>/dev/null)
test "$pid" && kill -9 $pid 2>/var/log/xdmshutdown.log
Then add the following two lines to the Xsetup file in the xdm
configuration directory. This assumes the executable is stored in
/usr/local/sbin.
/usr/local/sbin/xdmshutdown -geometry +350+400 &
echo $! > /var/run/xdmshutdown.pid
This is based on xtut9 at
http://xopendisplay.hilltopia.ca/2009/Mar/Xlib-tutorial-part-9----Buttons.html