Ok, this is what I did to get the wireless hotkey (Fn+F2) working on
F9:
Code:
su --login
yum install -y acpid
chkconfig acpid on
service acpid start
modprobe eeepc
echo "modprobe eeepc" >> /etc/rc.local
Create the following files:
gedit /etc/acpi/events/hotkeys.conf
Code:
event=hotkey ATKD .*
action=/etc/acpi/actions/hotkeys.sh %e
gedit /etc/acpi/actions/hotkeys.sh
Code:
#!/bin/bash
export DISPLAY=:0
case "$3" in
#Fn+F2
00000010)
# Wlan On
/etc/acpi/actions/wlan.sh poweron
;;
00000011)
# Wlan Off
/etc/acpi/actions/wlan.sh poweroff
;;
#Fn+F6
00000012)
# TaskManager
/usr/bin/gnome-system-monitor
;;
#Fn+F7
00000013)
# Volume mute
/usr/bin/amixer set -D hw:0 Master toggle
;;
#Fn+F8
00000014)
# Volume down
/usr/bin/amixer set -D hw:0 Master 10%- unmute
;;
#Fn+F9
00000015)
# Volume up
/usr/bin/amixer set -D hw:0 Master 10%+ unmute
;;
#Fn+F5
00000030)
/usr/bin/xrandr --output VGA --mode 1024x768 \
--output LVDS --off
if [[ "$?" != "0" ]]; then
/usr/bin/xrandr --output VGA --preferred \
--output LVDS --off
fi
;;
00000031)
/usr/bin/xrandr --output LVDS --mode 800x480 \
--output VGA --mode 800x600
;;
00000032)
/usr/bin/xrandr --output VGA --off \
--output LVDS --preferred
;;
*)
logger "ACPI hotkey $3 action is not defined"
;;
esac
gedit /etc/acpi/actions/wlan.sh
Code:
#!/bin/bash
PWR=$(cat /sys/devices/platform/eeepc/wlan)
UnloadModules() {
rmmod ath_pci
rmmod ath_rate_sample
rmmod wlan_scan_sta
rmmod wlan_tkip
rmmod wlan_wep
rmmod wlan
}
LoadModules() {
modprobe ath_pci
}
case $1 in
poweron)
if [[ "$PWR" = "0" ]]; then
modprobe pciehp pciehp_force=1
echo 1 > /sys/devices/platform/eeepc/wlan
rmmod pciehp
fi
;;
poweroff)
if [[ "$PWR" = "1" ]]; then
modprobe pciehp pciehp_force=1
ifconfig ath0 down
wlanconfig ath0 destroy
UnloadModules
echo 0 > /sys/devices/platform/eeepc/wlan
rmmod pciehp
fi
;;
esac
Make scripts executable:
Code:
chmod -v +x /etc/acpi/actions/*
Now restart acpid to reload events configurations:
Code:
service acpid restart
It is working like a charm!
duli
PS: If you want the Fn+F5 key also working, you're gonna have to grant permission from xhost like this:
Code:
echo "xhost +local:root " >> ~/.bash_profile
and to reset it on logout:
Code:
echo "xhost +local:root " >> ~/.bash_logout