Skip to content

Unmask ThinkPad Bluetooth F10 via thinkpad_acpi bit 20 - #13615

Open
AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:cursor/fix-thinkpad-bt-hotkey-e0d3
Open

AnPod wants to merge 3 commits into
omacom:quattrofrom
AnPod:cursor/fix-thinkpad-bt-hotkey-e0d3

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #13291

Stock thinkpad_acpi hotkey masks omit the Bluetooth bit on some ThinkPads (e.g. T490), so F10 is inert.

Change

  • Ship a verified bit-20 mask (hotkey=enable,0xff9c7ffb) instead of an all-bits widen
  • Install under Lenovo hardware setup (DMI match) with live sysfs OR when writable
  • Migrate existing installs; document in hotkeys manual
  • Cover with test/shell.d/thinkpad-bluetooth-hotkey-test.sh

Test plan

  • bash test/shell.d/thinkpad-bluetooth-hotkey-test.sh
  • On a ThinkPad with thinkpad_acpi, confirm F10 emits a Bluetooth key/rfkill event after reboot or live mask write

@cursor
cursor Bot force-pushed the cursor/fix-thinkpad-bt-hotkey-e0d3 branch from 491b8f5 to 4e97128 Compare September 29, 2026 21:10
@omarchybot omarchybot added the enhancement New feature or request label Oct 3, 2026
@echennells

Copy link
Copy Markdown

Tested 4e971287 on a ThinkPad T14 Gen 2a (20XLS0A300) with Omarchy 4.0.4-1 and kernel 7.2.5-3-omarchy. It has the same default hotkey_mask as the T490 here (0xff8c7ffb). Two findings:

1. The drop-in doesn't take effect at the next boot on Omarchy. thinkpad_acpi is in the initramfs and loads at ~1.1 s, before the encrypted root is even unlocked. So its options come from the initramfs copy of /etc/modprobe.d, which the PR never refreshes.

  • With the drop-in installed and a reboot, the mask was still 0xff8c7ffb.
  • Later, an unrelated DKMS package install triggered the mkinitcpio hook, which rebuilt the UKI with the drop-in baked in. Only on the boot after that was the mask 0xff9c7ffb.

So the leaf's comment ("takes effect on the next module load / reboot") doesn't hold here. The migration would need to regenerate the initramfs/UKI. Also, the live path ORs bit 20 into the current mask, but the drop-in hardcodes the T490's full value for every ThinkPad match. On this T14 the two agree, but on a model with a different recommended mask the boot-time value would differ from the live one.

2. On the T14 Gen 2a, F10 isn't a Bluetooth key. It carries a phone icon and sends a plain KEY_F10 from the AT keyboard, with and without bit 20, and no rfkill switch changes.

With 0xff9c7ffb set, I pressed volume up and down (6 presses each), mute and mic mute. Each produced exactly one event per press, with no duplicates. So it's harmless here; it just doesn't do anything.

Also, per the issue's own description, F10 on the T490 flips tpacpi_bluetooth_sw, so hci0 vanishes and comes back. That's the platform switch #7936/#12753 deliberately avoid, so on those models F10 still cuts the radio's power the way #7936 describes, even with #12753 merged.

Tested with help from Claude Code; every run was on my machine.

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks for this, and thanks @echennells for the T14 test. Adding a few things from reading the diff:

  • BLOCKING: the live mask write never runs. [[ -w $mask_path ]] is checked as the user, and /sys/devices/platform/thinkpad_acpi/hotkey_mask is root-only, so the test is false in both the install step and the migration. Since sudo tee is already there, check for existence instead:
    if [[ -e $mask_path ]]; then
      current=$(<"$mask_path")
      printf '%#x\n' "$((current | 0x00100000))" | sudo tee "$mask_path" >/dev/null || true
    fi
  • The drop-in hardcodes the T490's mask for every ThinkPad. hotkey=enable,0xff9c7ffb replaces each model's own recommended mask, so on a ThinkPad whose default differs, bits it normally enables get turned off at boot. The live path ORs bit 20 in, which is the safer shape. The boot-time path should do the same, or be limited to the models that are verified.
  • It needs an initramfs rebuild to take effect. As @echennells found, thinkpad_acpi loads from the initramfs, so the migration has to run limine-mkinitcpio (or add the conf to FILES).
  • migrations/1790544300.sh removes /etc/modprobe.d/omarchy-thinkpad-hotkey.conf, but nothing on quattro ever created that file, so that block can go.

The bigger question is the one from the T14 test: F10 toggling tpacpi_bluetooth_sw cuts radio power the way #7936 and #12753 deliberately avoid. Whether to enable it at all seems like a maintainer call.

@AnPod
AnPod force-pushed the cursor/fix-thinkpad-bt-hotkey-e0d3 branch from 4e97128 to 54f9cff Compare October 10, 2026 05:33
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High impact] The PR appears safe to merge; no actionable new issue was found.

Summary

Enables the ThinkPad Bluetooth hotkey without replacing the model’s existing mask.

  • ThinkPad Bluetooth F10 gets enabled without changing other hotkeys.

Reviews (2) · Last reviewed commit: "Warn when the ThinkPad hotkey mask can't..." · Reviewed by Greptile

cursoragent and others added 3 commits October 11, 2026 07:30
Check that the hotkey_mask file exists rather than that it is writable by
the user, so the live write through sudo tee actually runs. Replace the
modprobe drop-in, which forced the T490 mask on every ThinkPad, with a
oneshot system unit that ORs bit 20 into the model's current mask on each
boot. Drop the migration's removal of a file nothing ever created.
Keep the boot fix nonfatal, but log why bit 20 wasn't applied so the install log and service journal explain an unchanged Bluetooth hotkey.
@jandrusk

Copy link
Copy Markdown

Thanks, this addresses the blocking point. The helper now checks -e, runs as root (from the oneshot unit and through sudo at install), and ORs bit 20 into whatever mask the model already has. That also removes the hardcoded T490 mask and the initramfs question. The remaining question is the product one from the T14 test: whether F10 should toggle tpacpi_bluetooth_sw at all, given #7936 / #12753. That's for the maintainers.

@omarchybot omarchybot removed the enhancement New feature or request label Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Classification for this pull request is unsettled at e46e48f, so it carries no class label for now and has not been run on a worker.

Two models classified it separately: Claude Opus 5.5 called it an enhancement, because the kernel's recommended mask leaves the Bluetooth hotkey off and this turns it on deliberately, giving F10 a new action. Codex Medium called it a compatibility fix, because the linked issue describes a key that does nothing on one ThinkPad model. Both readings hold up. Which one is right depends on the question @jandrusk and @echennells already raised above: on the T490, F10 flips tpacpi_bluetooth_sw, which cuts power to the radio, and that is the platform switch #7936 and #12753 deliberately avoid. On the T14 Gen 2a, F10 is not a Bluetooth key at all.

Whether F10 should toggle that switch is a product decision, so this waits on the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F10 (Bluetooth) hotkey is inert on ThinkPad T490 — thinkpad_acpi's default hotkey_mask omits the Bluetooth bit

5 participants