Hello, On 2016-06-28 Tue 15:27 PM |, Craig Skinner wrote: > This diff presents 'Halt' and 'Reboot' buttons on the xdm screen. >
Now it closes the message box + adds 'Hibernate' & 'Suspend' buttons. > > Adapted from http://cafim.sssup.it/~giulio/other/Customization_XDM.html > --- /etc/X11/xdm/Xsetup_0 2016/06/28 14:20:18 1.1 +++ /etc/X11/xdm/Xsetup_0 2016/06/28 17:14:54 @@ -1,8 +1,31 @@ #!/bin/sh -# $OpenBSD: Xsetup_0,v 1.1 2016/06/28 13:20:18 craig Exp $ +# $OpenBSD: Xsetup_0,v 1.6 2016/06/28 16:16:11 craig Exp $ if [ "$DISPLAY" = ":0" -o "$DISPLAY" = ":0.0" ] then xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail + + # Show Halt and Reboot buttons: + ( + xmessage -buttons 'Halt:20,Reboot:21,Suspend:22,Hibernate:23' ' System: ' + case $? in + 20) + halt -p >/dev/console 2>&1 + ;; + 21) + reboot >/dev/console 2>&1 + ;; + 22) + zzz >/dev/console 2>&1 + ;; + 23) + ZZZ >/dev/console 2>&1 + ;; + *) + print 'xdm halter closed' >/dev/console + ;; + esac + ) & + fi #sxpm OpenBSD.xpm & --- /etc/X11/xdm/GiveConsole 2015/06/30 16:44:10 1.2 +++ /etc/X11/xdm/GiveConsole 2016/06/28 17:07:28 @@ -1,6 +1,11 @@ #!/bin/sh # Assign ownership of the console to the invoking user -# $OpenBSD: GiveConsole,v 1.2 2015/06/30 15:44:10 craig Exp $ +# $OpenBSD: GiveConsole,v 1.3 2016/06/28 16:09:24 craig Exp $ +# + +# Started in Xsetup_0 +pkill xmessage + # # By convention, both xconsole and xterm -C check that the # console is owned by the invoking user and is readable before attaching
