Enable WLAN with a hotkey
Step 1: Installing the ACPI4Asus driver

The first thing you'll need is the latest ACPI4Asus driver.
Compile the module and install it. The modified acpid coming with the driver is not needed.
modprobe asus_acpi
Now install the acpid deamon.
apt-get install acpid
Create the file /etc/acpi/events/logger with the following content.
#/etc/acpi/events/logger
event=.*
action=logger "event [%e]"
							
Restart the acpid deamon and press the hotkeys, they should generate ACPI events now which are logged using our logger "event" from above.
Mär 26 19:19:35 mhcln03 logger: event [hotkey ATKD 00000051 00000000]
Mär 26 19:19:36 mhcln03 logger: event [hotkey ATKD 00000050 00000000]
Mär 26 19:19:39 mhcln03 logger: event [hotkey ATKD 00000052 00000001]	
							
One of the four hotkeys is lit blue when active. That's our WLAN button :)
It generates different events when turning WLAN on and off.


Step 2: Capturing the ACPI events

We need to configure two different ACPI events. I'll call them centrino_start and centrino_stop.

Content of /etc/acpi/events/centrino_start:
#/etc/acpi/events/centrino_start
event=.*hotkey.*5e[[:space:]].*
action=/usr/scripts/centrino start
							
Content of /etc/acpi/events/centrino_stop:
#/etc/acpi/events/centrino_stop
event=.*hotkey.*5f[[:space:]].*
action=/usr/scripts/centrino stop
							
Step 3: The script

Download the script and place it in /usr/scripts. Note that it uses DHCP to get an IP. You may need to edit it to use static IPs.

Ok, time for a test-run. Press the WLAN button and the card should spring to life automagically. At the same time any active "wired" connection will be removed.

That's it! Have fun :)
Samsung P30 Index
Sunday, 24-Jul-2005 16:54:03 CEST

Valid HTML 4.0!
Powered by Linux, © Matthias Hentges 2004
Webmaster

Valid CSS!