Inspiron 1100 power button hack
- Firstly, this hack does not get the power button to work, but instead
uses that little "i" button next to it to do whatever you want (possibly
even a power down command).
Note - requires acme, and I am not sure that it will work for anyone...
but good luck.
When pressing the "i" button I got an output on virtual console 1 (alt
"atkbd.c: Unknown key pressed. (translated set 2, code 0x81 on
atkbd.c: Use 'setkeycodes e001 <keycode>' to make it known."
So I decided to give it a try. I used
setkeycodes e001 112
(I do not think that 112 is currently used for anything, but I could be
Now when I press the "i" button I get the keycode 112.
This key is also now recognised by X11 (currently debian testing, so
XFree86 4.3, hopefully it will still be like this in xorg).
Since I am using kde 3.3 I do not have a "special keys function" built
into the desktop environment, so I am using acme (as was recommended on
www.geocities.com/randomnumbergenerator2001). (It could be the case that
newer desktop environments have this function built in, I think acme was
integrated into gnome).
Now I can use the "i" button as a special button (like the multimedia
buttons) and assign it a task in acme.
Unfortunately in acme you have to use pre-made actions, eg www key,
calculator key ...
But there is a Power key. So you could map the "i" key to that if you
wanted (but for me under kde it just tries to log me out, but I haven't
really looked into this). But there is a special key, the eject key.
So I mapped it to "eject". If your use the eject key a lot, this may not
be useful, I shut down more often than I eject the cd anyhow, and there
is a button on the cd-drive. So I would prefer to lose the eject key and
gain a power button. Now in acme, the eject key, unlike many others,
does not seem to be mapped to a certain action, but rather a command,
namely 'eject'. So I went into 'gconf-editor' and searched for "acme".
Then went to /apps/acme and changed the value of "eject-command" from
"eject" to "/home/ejd/hibernate".
Since I use software suspend I want this button to map to a suspend
button. So I created a script in /home/ejd called hibernate, made it so
it runs 'hibernate' as root with sudo, and made it so it didn't need a
E.g. the script contains the line
Now when I press the "i" button, it runs the script
in /home/ejd/hibernate, which hibernates my computer.
To test things, try 'setkeycodes e001 001' first. The keycode 001 maps
to escape, so you should get the "i" button working as an escape button.
Then change it to 112, and test acme (or another similar programme) with
a normal action. Then change it to eject. Then change the eject command
to a simple script which you can test the results of, e.g. 'echo "It
worked" > ibuttontest'. Then alter the script to do whatever you want it
to do. Note, the scripts in /etc/acpi/ may be good choices if you want
to use it as a power button etc.
On further testing, gnome 2.8 has its own "Keyboard Shortcuts" part,
which I think is just acme which has been integrated. So mapping the "i"
to eject there can work. But I do not know how to remap the command of
the particular buttons to scripts. They need to add user-editable
commands!!!!!!!! There may be a configuration file that holds this
stuff, but I had a quick look through the gconf and could not find one.
There may be something to be found on mailing lists or something
somewhere, or in documentation, but as of writing, "gnome.org is moving"
and hence, useless. At worst, you may now be able to use the "i" button
as a button for some pre-programmed action.
At the moment the only problem I get is that a eject cd image is
displayed when pressing the button. But, at least it still hibernates.