ACPI_IBM(4)
π acpi_ibm β the ACPI extras driver for IBM laptops π
okay bestie, sit DOWN, because this is the acpi_ibm(4) page and it's genuinely iconic. it lives in the Kernel Interfaces Manual, and it's about to tell you everything about hotkeys on IBM ThinkPads. no cap. π«Ά
β¨ NAME β¨
acpi_ibm β ACPI extras driver for IBM laptops
β¨ SYNOPSIS β¨
so there's two ways to get this driver living in your life. pick your fighter. π
Way 1: compile it straight into the kernel. drop this line in your kernel configuration file:
device acpi_ibm
Way 2: load it as a module at boot time. put this line in loader.conf(5):
acpi_ibm_load="YES"
β¨ DESCRIPTION β¨
okay so acpi_ibm is the driver that handles hotkeys and other components of IBM laptops. its whole thing β its main character purpose, if you will β is giving you an interface you can reach through sysctl(8) and devd(8), so your applications can figure out the status of all the various laptop components. it's giving middleman, but make it useful. πΈ
here's the tea tho: the sysctl(8) interface just turns itself on automatically after you load the driver. easy. effortless. slay. π but the devd(8) interface? nope, you have to enable that one explicitly, because it might alter the default action of certain keys. so you turn it on by setting the events sysctl, which we get into below.
now, how do you tell it which keys should generate events? with a bitmask, bestie. every bit = one key or key combo. this bitmask lives at the eventmask sysctl, and by default it's set to availmask β which is the value representing literally all the possible keypress events on your specific ThinkPad model. it just knows. π«
π devd(8) Events π
the hotkey events that devd(8) receives come with the following info:
system "ACPI"
subsystem "IBM"
type The source of the event in the ACPI namespace. The
value depends on the model.
notify Event code (see below).
depending on the ThinkPad model, event codes may vary. on a ThinkPad T41p, they're giving:
0x01 Fn + F1
0x02 Fn + F2
0x03 Fn + F3 (LCD backlight)
0x04 Fn + F4 (Suspend to RAM)
0x05 Fn + F5 (Bluetooth)
0x06 Fn + F6
0x07 Fn + F7 (Screen expand)
0x08 Fn + F8
0x09 Fn + F9
0x0a Fn + F10
0x0b Fn + F11
0x0c Fn + F12 (Suspend to disk)
0x0d Fn + Backspace
0x0e Fn + Insert
0x0f Fn + Delete
0x10 Fn + Home (Brightness up)
0x11 Fn + End (Brightness down)
0x12 Fn + PageUp (ThinkLight)
0x13 Fn + PageDown
0x14 Fn + Space (Zoom)
0x15 Volume Up
0x16 Volume Down
0x17 Mute
0x18 Access IBM Button
π¦ led(4) Interface π¦
the acpi_ibm driver also hooks you up with a led(4) interface for the ThinkLight. wanna make the ThinkLight blink? just write ASCII strings to the /dev/led/thinklight device. that's it. that's the whole vibe. β¨
β¨ SYSCTL VARIABLES β¨
here are all the sysctls currently implemented, no gatekeeping:
dev.acpi_ibm.0.initialmaskβ (read-only) bitmask of ACPI events before theacpi_ibmdriver was loaded.dev.acpi_ibm.0.availmaskβ (read-only) bitmask of all supported ACPI events.dev.acpi_ibm.0.eventsβ enables ACPI events and sets theeventmasktoavailmask. heads up: without theacpi_ibmdriver being loaded, only the Fn+F4 button generates an ACPI event.dev.acpi_ibm.0.eventmaskβ sets which ACPI events get reported todevd(8). important note bestie: Fn+F3, Fn+F4 and Fn+F12 always generate ACPI events, regardless of whatever valueeventmaskhas. and depending on your ThinkPad model, the meaning of different bits in theeventmaskmay vary. on a ThinkPad T41p it's a bitwise OR of the following:1β Fn + F12β Fn + F24β Fn + F3 (LCD backlight)8β Fn + F4 (Suspend to RAM)16β Fn + F5 (Bluetooth)32β Fn + F664β Fn + F7 (Screen expand)128β Fn + F8256β Fn + F9512β Fn + F101024β Fn + F112048β Fn + F12 (Suspend to disk)4096β Fn + Backspace8192β Fn + Insert16384β Fn + Delete32768β Fn + Home (Brightness up)65536β Fn + End (Brightness down)131072β Fn + PageUp (ThinkLight)262144β Fn + PageDown524288β Fn + Space (Zoom)1048576β Volume Up2097152β Volume Down4194304β Mute8388608β Access IBM Button
dev.acpi_ibm.0.hotkeyβ (read-only) status of several buttons. every time a button is pressed, the respecting bit is toggled. it's a bitwise OR of the following:1β Home Button2β Search Button4β Mail Button8β Access IBM Button16β Zoom32β Wireless LAN Button64β Video Button128β Hibernate Button256β ThinkLight Button512β Screen Expand1024β Brightness Up/Down Button2048β Volume Up/Down/Mute Button
dev.acpi_ibm.0.lcd_brightnessβ current brightness level of the display.dev.acpi_ibm.0.volumeβ speaker volume.dev.acpi_ibm.0.muteβ indicates whether the speakers are muted or not.dev.acpi_ibm.0.thinklightβ indicates whether the ThinkLight keyboard light is activated or not.dev.acpi_ibm.0.bluetoothβ toggle Bluetooth chip activity.dev.acpi_ibm.0.wlanβ (read-only) indicates whether the WLAN chip is active or not.dev.acpi_ibm.0.fanβ indicates whether the fan is in automatic (1) or manual (0) mode. default is automatic mode. π¨ bestie, be so careful with this one β this sysctl should be used with extreme precaution, because disabling automatic fan control might overheat the ThinkPad and lead to permanent damage if thefan_levelis not set accordingly. i am not joking, this is real.dev.acpi_ibm.0.fan_levelβ indicates at what speed the fan should run when being in manual mode. valid values range from0(off) to7(max) and8. level8is used by the driver to set the fan in unthrottled mode. in this mode, the fan is set to spin freely and will quickly reach a very high speed. use this mode only if absolutely necessary, e.g., if the system has reached its critical temperature and it is about to shut down. the resulting speed differs from model to model. on a T41p this is as follows:0β off1, 2β ~3000 RPM3, 4, 5β ~3600 RPM6, 7β ~4300 RPM8β ~6400 RPM (Full-speed, unthrottled)
dev.acpi_ibm.0.fan_speedβ (read-only) fan speed in rounds per minute. a few older ThinkPads report the fan speed in levels ranging from0(off) to7(max).dev.acpi_ibm.0.thermalβ (read-only) shows the readings of up to eight different temperature sensors. most ThinkPads include six or more temperature sensors but only expose the CPU temperature throughacpi_thermal(4). some ThinkPads have the below sensor layout, which might vary depending on the specific model:- CPU
- Mini PCI Module
- HDD
- GPU
- Built-in battery
- UltraBay battery
- Built-in battery
- UltraBay battery
dev.acpi_ibm.0.handlereventsβdevd(8)events handled byacpi_ibmwheneventsis set to1. events are specified as a whitespace-separated list of event code in hexadecimal or decimal form. note that the event maybe handled twice (e.g., Brightness up/down) if ACPI BIOS already handled the event. π
defaults for these sysctls can be set in sysctl.conf(5). π«Ά
β¨ FILES β¨
/dev/led/thinklightβ ThinkLightled(4)device node
β¨ EXAMPLES β¨
okay bestie, this is the part where it gets fun π you can literally wire your ThinkPad's buttons up to your own script. here's how.
drop this into devd.conf(5) and every button event gets handed off 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";
};
and likeβ¦ what would that script even look like? glad you asked π
here's a possible /usr/local/sbin/acpi_oem_exec.sh:
#!/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
;;
*)
;;
esac
${LOGGER} ${MESSAGE}
if [ -p ${DISPLAY_PIPE} ]
then
${ECHO} ${MESSAGE} >> ${DISPLAY_PIPE} &
fi
exit 0
so cute, so useful π (the ${LEVEL} / ${MAX_LCD_BRIGHTNESS} * 100 bit is just turning a raw 0β7 into a percent for you, iykyk)
and if you want to be specific about which buttons acpi_ibm should handle, here's an example saying event code 0x04 (Suspend to RAM), 0x10 (Brightness up) and 0x11 (Brightness down) are all on acpi_ibm's plate:
sysctl dev.acpi_ibm.0.handlerevents='0x04 0x10 0x11'
and the same energy, but inside sysctl.conf(5) (note the escaped spaces, she's picky π):
dev.acpi_ibm.0.handlerevents=0x04\ 0x10\ 0x11
πΈ SEE ALSO πΈ
π HISTORY π
the acpi_ibm device driver first appeared in FreeBSD 6.0. an icon, a legend, a moment in time β
π AUTHORS π
the acpi_ibm driver was written by Takanori Watanabe <takawata@FreeBSD.org> and later mostly rewritten by Markus Brueffer <markus@FreeBSD.org>. this manual page was written by Christian Brueffer <brueffer@FreeBSD.org> and Markus Brueffer <markus@FreeBSD.org>. absolute main characters, no cap π«Ά
and that's the whole page bestie!! π
this was the Debian build, dated June 24, 2020, for ACPI_IBM(4) β go forth and press buttons, you got this π¦β¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2005 Christian Brueffer
- Copyright (c) 2005 Markus Brueffer
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms