[Prototype] Re: Is disabling ctrl-alt-backspace really such a good idea?

John McCabe-Dansted gmatht at gmail.com
Wed Feb 11 16:07:37 UTC 2009


On 2/11/09, Scott Kitterman <ubuntu at kitterman.com> wrote:
> It's 9 days until feature freeze, so if you want it different I suggest
> sending patches.

Below is a prototype that I mocked up in half an hour; it gives a 10
second countdown. It would seem that something usable in 8 days is a
possibility if someone familiar with Ubuntu and X wants to

1) Approve the idea, perhaps with additional requirements. Does anyone
have objections to the user-interface of this script?

2) Set Cntl-Alt-Backspace to be a keyboard shortcut for this script.
Would setting this in Gnome/KDE/Xfce suffice? Or would these be likely
to be not working when we need them? My X crashes usually occur after
Gnome has loaded and I have started doing heavy 3D work.

3) Give the script some way to kill X. Perhaps add the following line
to the default sudoers:
   %plugdev ALL=NOPASSWD: killall Xorg

Although this was intended as a prototype, using zenity seems OK.
However wmctrl does not seem to be in
  http://cdimage.ubuntu.com/releases/jaunty/alpha-4/jaunty-desktop-i386.manifest
Is there an alternative way of raising a window to the foreground?

--

#!/bin/bash
# Script to kill X, but give user 10 seconds to cancel
################################################################################

# NOTE: Add keyboard shortcut so this is run when Ctrl-Alt-Del is run.
# NOTE: Allow logged in user to run "sudo /etc/init.d/gdm restart" or
#       "sudo /etc/init.d/gdm" restart without a password

TITLE="Really Restart X Server?"
TEXT="You pressed Ctrl-Alt-Backspace.
This is an emergency sequence to restart a frozen computer.
If you do not want to lose your unsaved data click Cancel NOW!"

which zenity || echo zenity missing, run sudo apt-get install zenity
which wmctrl || echo wmctrl missing, run sudo apt-get install wmctrl

i=0
while [ "$i" -le 100 ]
do
        echo $i
        sleep 0.1
        wmctrl -R "$TITLE" #raise window
        i=$(($i+1))
done | (
        zenity --progress --title="$TITLE" --text="$TEXT" --auto-close &&
        echo TESTONLY sudo killall Xorg
        #echo TESTONLY /etc/init.d/gdm restart
)

-- 
John C. McCabe-Dansted
PhD Student
University of Western Australia




More information about the Ubuntu-devel-discuss mailing list