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

Re: Summary: logout/halt/reboot as ordinary user, gnome logout button?

On Tue, 14 Dec 1999 ressu@uusikaupunki.fi wrote:

> the shutdown button could be an external program, just like xbanner
> changes the background, some other program could run like xbanner and
> start when xdm/gdm starts and make a button, and die after the
> login...

Ever since I brough this up here a couple of years ago, I've used this
simple incantion in /etc/X11/xdm/Xsetup_0:

pear# cat /etc/X11/xdm/Xsetup_0
# $XConsortium: Xsetup_0,v 1.3 93/09/28 14:30:31 gildea Exp $

if grep -q ^run-xconsole /etc/X11/config; then
  xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed \
    -exitOnFail -file /dev/xconsole

touch /var/run/xdm.ok._0

# reboot button
/usr/bin/wish <<EOF &
  wm geometry . +0-0
  button .halt   -text Halt   -command {exec shutdown -h now}
  button .reboot -text Reboot -command {exec shutdown -r now}
  pack .halt .reboot -side left
  echo $! > /var/run/xdmbutton_0.pid

Then Xstartup kills them:

pear# cat /etc/X11/xdm/Xstartup_0
# This script is run as root after a user starts a session on :0.

set -e

# Call the global Xstartup script, if it exists
if [ -x /etc/X11/xdm/Xstartup ]; then

# This bit doesn't matter, so set +e
set +e

# :0 specific startup commands go here
# reboot button
for i in /var/run/xdm*_0.pid; do
    kill `cat $i`
    rm $i

exit 0


|  Jelibean aka  | jules@jellybean.co.uk         |  6 Evelyn Rd	       |
|  Jules aka     | jules@debian.org              |  Richmond, Surrey   |
|  Julian Bean   | jmlb2@hermes.cam.ac.uk        |  TW9 2TF *UK*       |
|  War doesn't demonstrate who's right... just who's left.             |
|  When privacy is outlawed... only the outlaws have privacy.          |

Reply to: