FREE CODE: xdm Shutdown Button

FREE CODE: xdm Shutdown Button

Post by Mike Wye » Fri, 03 Jul 1998 04:00:00



For anyone who wants an easy way of shutting down / restarting their
machine from the xdm login screen (instead of Ctrl-Alt-F1 Ctrl-Alt-Del):
This is a set of two tcl/tk scripts- one which pops up the button, the
other to kill the button once a user has logged in.
All it requires is tcl/tk, and that the shutdown script is
/sbin/shutdown
Of course, this can be edited for your own needs.
The code itself is just one line, but it needs all the gunk to make it
work.

This was created to allow easy dual booting between Linux and Windows,
encouraging users to shut the machine down properly to avoid 10 minute
"fsck"ing.

It's been in operation in the Imperial College Computing Department for
the last three months without a problem (apart from the usual cretins
hitting reset instead of waiting for the machine to shutdown properly.
Bring back birching, I say ;-)

Anyway, here's the important bit. Everything happens in /etc/X11/xdm/

Create the text file Xshutdown containing the following:
#!/bin/sh
# the next line restarts using 'wish'. Don't remove this: \

# This script starts a "Shutdown and Reboot" button
# This allows easier dual booting in RunLevel 5
# Created by Mike Wyer (unsung genius)
button .b -text "Shutdown\nand Reboot" -command "exec /sbin/shutdown -t3 -r now"
pack .b
#===== Don't copy this- it's just the end of the file ================

Then the file Xshutup:
#!/bin/sh # the next line restarts using 'wish'. Don't remove this: \

# This kills the "Shutdown and Reboot" button in Xshutdown.
# If you run it from a prompt it will always produce an error message,
# but it does always produce the behaviour required:
# ie. After this has run, Xshutdown will not be running.
# Created by Mike Wyer, shamelessly stolen by: ___(your name here)___
send Xshutdown exit
exit
#===== End of File ==================================================

Then add the following line to the end of Xsetup_0:
/etc/X11/xdm/Xshutdown &

And finally, add this to GiveConsole:
/etc/X11/xdm/Xshutup

NB: Make sure the two new files are set as executable:
chmod +x Xshut*

Have fun. If you *do* use it- send me an email ('cos it'll impress my
boss). Otherwise - copy, distribute, praise, deify, print, and make
paper aeroplanes from it (like you need telling).
I would GPL it, but it's really not worth it. I hope it helps.
Cheers,
Mike

         //\\___________________________________//\\
      "I want to die in my sleep like my grandfather....
 ...Not screaming and yelling like the passengers in his car."

 
 
 

FREE CODE: xdm Shutdown Button

Post by Dale Ponti » Mon, 06 Jul 1998 04:00:00




Quote:> For anyone who wants an easy way of shutting down / restarting their
> machine from the xdm login screen (instead of Ctrl-Alt-F1 Ctrl-Alt-Del):

Thanks. (Actually, I haven't tried it, but will when I get time.)

I once heard of an xdm replacement that had buttons for each of a
small number of accounts on a machine, as well as a shutdown button.
This would be ideal for a family PC setting, but I haven't been able
to find the web site, again.

Can anyone else give me a pointer to such a thing?

Thanks,
Dale Pontius
edgehp+dale at together dot net

 
 
 

FREE CODE: xdm Shutdown Button

Post by Uwe Reede » Tue, 07 Jul 1998 04:00:00



> I once heard of an xdm replacement that had buttons for each of a
> small number of accounts on a machine, as well as a shutdown button.
> This would be ideal for a family PC setting, but I haven't been able
> to find the web site, again.

> Can anyone else give me a pointer to such a thing?

Try kdm from the K Desktop.
See http://www.kde.org

...Uwe

 
 
 

1. Taskbar "shutdown" button lost its options for shutdown

An other one of the KDE weirdies ...

The "shutdown / disconnect" button in my KDE 222 Mandrake (8.2 with
2.4.18 kernel) taskbar has lost its options effects ...
Options are : disconnect, shutdown, restart

Whatever the option, now, it wont shut or restart. it just disconnect
and brings me to the desktop login screen.

Any idea ?

BTW : has anyone come across this one : I have 4 desktops, each with a
specific background. When I launch Kwintv (0.8.11, compiled by ASP,
found on rpmfind), the backgrounds are not changed anymore when
switching desktop ...

Open a new section on annoyances.org ?

2. recursive mutexes in a driver - got a better way of spending the weekend

3. Macs: 1 button, Windows: 2 buttons, Unix: 104 buttons

4. firewall testing websites

5. Init Shutdown Sequence from Case's Power Button?

6. What is wrong with this rule

7. how to change style(shape) of radio buttons like shutdown,reboot etc

8. PROBLEM: (CRASH) oops in ext3

9. Reset button? Or shutdown?

10. shutdown on pressing the ATX power button

11. Shutdown with ATX Power Button on SuSE 8.1

12. one-button shutdown from KDE?

13. how to change style(shape) of radio buttons like shutdown,reboot etc