|
|
怎样使用IBM hotkey "Fn"
我在内核中打了suspend2,并且emerge hibernate-scripts
参照:http://forums.gentoo.org//viewto ... ght-ibm+hotkey.html
即:
- #!/etc/acpid/default.sh
- # Default acpi script that takes an entry for all actions
- set $*
- group=${1/\/*/}
- action=${1/*\//}
- case "$group" in
- button)
- case "$action" in
- power)
- logger "[ACPI] power button pushed"
- reboot
- ;;
- *)
- logger "[ACPI] action $action is not defined"
- ;;
- esac
- ;;
- ibm)
- case "$action" in
- hotkey)
- case "$4" in
- # Fn+F3
- 00001003)
- state=$(/usr/sbin/radeontool regs | grep RADEON_LVDS_GEN_CNTL)
- if [[ "$state" = "RADEON_LVDS_GEN_CNTL=003dffa1" ]] ; then
- cmd="off"
- else
- cmd="on"
- fi
- /usr/sbin/radeontool light "$cmd"
- logger "[ACPI] lcd backlight $cmd"
- ;;
- # Fn+F4
- 00001004)
- logger "[ACPI] FN+F4 not implemented yet"
- ;;
- # Fn+F5
- 00001005)
- state=$(cat /proc/acpi/ibm/bluetooth | awk '/enabled/ { print $2 }')
- if [[ $state == "no" ]] ; then
- cmd="enable"
- else
- cmd="disable"
- fi
- echo "$cmd" > /proc/acpi/ibm/bluetooth
- logger "[ACPI] $cmd bluetooth"
- ;;
- # Fn+F7
- 00001007)
- logger "[ACPI] FN+F7 not implemented yet"
- ;;
- # Fn+F9
- 00001009)
- state=$(/sbin/ifconfig ath0| awk '/ath0/ { print $5 }')
- if [[ $state == "11:22:33:44:55:66" ]] ; then
- /etc/init.d/wlan_uni stop
- else
- /etc/init.d/wlan_uni start
- fi
- ;;
- # Fn+F12
- 00001012)
- /usr/sbin/hibernate
- ;;
- # Hotkey Event default
- *)
- logger "[ACPI] ibm/hotkey HKEY $4 pushed but not defined"
- ;;
- esac
- ;;
- *)
- logger "[ACPI] No matching hotkey id found"
- ;;
- esac
- ;;
- *)
- logger "[ACPI] $*"
- ;;
- esac
复制代码
同时在/etc/conf.d/local.start加入
- echo "0x0150" >| /proc/acpi/ibm/hotkey
- echo "enable" >| /proc/acpi/ibm/hotkey
复制代码
可是怎么不管用??? |
|