|
NAME
SYNOPSISTo compile this driver into the kernel, place the following line in your kernel configuration file: device acpi_ibmAlternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): acpi_ibm_load="YES" DESCRIPTIONThe While the sysctl(8) interface is enabled automatically after loading the driver, the devd(8) interface has to be enabled explicitly, as it may alter the default action of certain keys. This is done by setting the events sysctl as described below. Specifying which keys should generate events is done by setting a bitmask, whereas each bit represents one key or key combination. This bitmask, accessible via the eventmask sysctl, is set to availmask by default, a value representing all possible keypress events on the specific ThinkPad model. devd(8) EventsHotkey events received by devd(8) provide the following information:
Depending on the ThinkPad model, event codes may vary. On a ThinkPad T41p these are as follows:
led(4) InterfaceThe SYSCTL VARIABLESThe following sysctls are currently implemented:
Defaults for these sysctls can be set in sysctl.conf(5). FILES
EXAMPLESThe following can be added to devd.conf(5) in order to pass button events to a /usr/local/sbin/acpi_oem_exec.sh script: notify 10 {
match "system" "ACPI";
match "subsystem" "IBM";
action "/usr/local/sbin/acpi_oem_exec.sh $notify ibm";
};
A possible /usr/local/sbin/acpi_oem_exec.sh script might look like: #!/bin/sh
#
if [ "$1" = "" -o "$2" = "" ]
then
echo "usage: $0 notify oem_name"
exit 1
fi
NOTIFY=`echo $1`
LOGGER="logger"
CALC="bc"
BC_PRECOMMANDS="scale=2"
ECHO="echo"
CUT="cut"
MAX_LCD_BRIGHTNESS=7
MAX_VOLUME=14
OEM=$2
DISPLAY_PIPE=/tmp/acpi_${OEM}_display
case ${NOTIFY} in
0x05)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.bluetooth`
if [ "$LEVEL" = "1" ]
then
sysctl dev.acpi_${OEM}.0.bluetooth=0
MESSAGE="bluetooth disabled"
else
sysctl dev.acpi_${OEM}.0.bluetooth=1
MESSAGE="bluetooth enabled"
fi
;;
0x10|0x11)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.lcd_brightness`
PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \
${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100" |\
${CALC} | ${CUT} -d . -f 1`
MESSAGE="brightness level ${PERCENT}%"
;;
0x12)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.thinklight`
if [ "$LEVEL" = "1" ]
then
MESSAGE="thinklight enabled"
else
MESSAGE="thinklight disabled"
fi
;;
0x15|0x16)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.volume`
PERCENT=`${ECHO} "${BC_PRECOMMANDS} ; \
${LEVEL} / ${MAX_VOLUME} * 100" | \
${CALC} | ${CUT} -d . -f 1`
MESSAGE="volume level ${PERCENT}%"
;;
0x17)
LEVEL=`sysctl -n dev.acpi_${OEM}.0.mute`
if [ "$LEVEL" = "1" ]
then
MESSAGE="volume muted"
else
MESSAGE="volume unmuted"
fi
;;
0x1b)
LEVEL=`sysctl -n dev.acpi_ibm.0.mic_led`
if [ $LEVEL -eq 0 ]; then
sysctl dev.acpi_ibm.0.mic_led=1
mixer rec.volume=0
fi
if [ $LEVEL -eq 1 ]; then
sysctl dev.acpi_ibm.0.mic_led=0
mixer rec.volume=30%
fi
;;
*)
;;
esac
${LOGGER} ${MESSAGE}
if [ -p ${DISPLAY_PIPE} ]
then
${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
fi
exit 0
The following example specify that event code 0x04 (Suspend to
RAM), 0x10 (Brightness up) and 0x11 (Brightness down) are handled by
sysctl dev.acpi_ibm.0.handlerevents='0x04 0x10 0x11' in sysctl.conf(5): dev.acpi_ibm.0.handlerevents=0x04\ 0x10\ 0x11 SEE ALSOHISTORYThe AUTHORSThe
|