-   Linux - General (
-   -   Special Keybind CTRL+ALT+END (

fr0zen 05-24-2004 10:31 PM

Special Keybind CTRL+ALT+END
I'm wondering how I can associate CTRL+ALT+END with a system halt.

I've noticed that in /etc/inittab there's an entry:


ca:12345:ctrlaltdel:/sbin/shutdown -r now
The above allows me to reboot with CTRL+ALT+DEL (only works on VTERMs though). I tried the following:


ca:12345:ctrlaltend:/sbin/shutdown -h now
Didn't work though.

What would I need to do? I'm tired of switching to a vterm, logging in as root, and typing the whole command out. When I reboot, I don't need to log in, or log in as root. I just CTRL+ALT+DEL. I'm looking to do CTRL+ALT+END for halting.


Mega Man X 05-24-2004 10:33 PM

Maybe you could use some third part programs for key grabbing as Xbindkeys and associate the keys you want with shutdown -h now command ;)

fr0zen 05-24-2004 10:36 PM

I have Xbindkeys installed. I use it in X, though. And the keybinds don't carry over to vterms.

Dark_Helmet 05-25-2004 12:07 AM

Pull up a terminal and do "man inittab"

On my system, there is an "action" field (corresponding to the ctrlaltdel field), and it has an available value of kbrequest. Reading the short description of it, it sounds like what you're looking for. However, I know nothing about the keymaps file or where to locate the documentation you need in the kbd package. It's a start though.

fr0zen 05-25-2004 01:08 AM

Thanks! That was exactly what I needed. I got it working, though, with CTRL+ALT+INSERT. INSERT seems more fitting for the command than END, so, I'm not going to bother setting it up for END.

Anyway, this is what I did

1) First you need to put this line in your /etc/inittab

kb:12345:kbrequest:/sbin/shutdown -t1 -h now
2) Then, you need to find the location of the DEFAULT keymap. It's called on my system. For me, it's located in /usr/share/kbd/keymaps.

3) Even though this file has a .gz extension, it isn't gzipped. Open it with your favorite text editor.

4) Proceed all the way down to the bottom of the file, and paste in the following:

keycode 110 = Insert
        altgr  control keycode 110 = KeyboardSignal
        control alt    keycode 110 = KeyboardSignal

You'll need to restart the system after making these changes. If your system does not call loadkeys -d at boot, you'll need to call it yourself otherwise the changes wont be present.

Then, just CTRL+ALT+F{1,2,3,4,5,6} into a VTERM and test it out! CTRL+ALT+INSERT.

Make sure you close/save your data in X or where ever. Wouldn't want to lose it now would we?

the above has been tested on my system and i make no guarantees that it will work on yours

All times are GMT -5. The time now is 04:27 PM.