Skip to content

Don't count the T2 Touch Bar as an external monitor - #14994

Open
omarchybot wants to merge 1 commit into
quattrofrom
fix/issue-10618
Open

omarchybot wants to merge 1 commit into
quattrofrom
fix/issue-10618

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

On a T2 Mac with tiny-dfr installed, closing the lid never locks the screen. omarchy-system-lid-close locks only when omarchy-hw-external-monitors says no external display is connected, and that check counts every connected DRM connector that is not eDP, LVDS or DSI. The Touch Bar is driven by the kernel's appletbdrm driver as a DRM card of its own, with a USB connector (card2-USB-2 on the reporter's MacBookPro15,2) that always reads connected. So the check is always true on these machines, the lock never starts, omarchy-hw-clamshell reports clamshell mode with the lid shut, and omarchy-hw-recover-internal-monitor never clears its toggle.

This skips a connector whose card is bound to appletbdrm (/sys/class/drm/cardN/device/driver). The check stays on DRM rather than moving to Hyprland's monitor list, because it reads hardware on purpose so it answers before the compositor has settled. It also stays narrower than excluding USB connectors, because USB-C displays on Apple Silicon arrive on USB connectors too (see omarchy-system-lid-inhibit). appletbdrm binds only the Touch Bar (05ac:8302), so no real external display matches it.

Omarchy stopped shipping tiny-dfr in migration 1785944594, so this affects people who installed it themselves. The cost there is a lid close that leaves the session unlocked, and the fix is a single sysfs lookup.

The new cases in test/shell.d/hw-external-monitors-test.sh build the sysfs shape from the reporter's evidence. They fail on quattro and pass with this change. A worker cannot fake a T2 Touch Bar, so I've asked the reporter on #10618 to try this branch on their machine. Codex Medium reviewed the diagnosis and the change and found no defect. It suggested the fixture use relative links the way sysfs does, and it now does.

Fixes #10618

With tiny-dfr installed, the T2 Touch Bar is a DRM card of its own (appletbdrm) whose USB connector always reads connected, so omarchy-hw-external-monitors was always true and a lid close never locked. Skip connectors on an appletbdrm card rather than every USB connector, which is where Apple Silicon's USB-C displays arrive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

omarchy-hw-external-monitors now skips connected cards bound to appletbdrm, so the T2 Touch Bar no longer counts as an external monitor.

  • The external-monitor check skips the T2 Touch Bar but keeps other USB displays.

Reviews (1) · Last reviewed commit: "Don't count the T2 Touch Bar as an exter..." · Reviewed by Greptile

@jandrusk

Copy link
Copy Markdown

Overlap: #11516 ("Ignore USB Touch Bar DRM when detecting external displays") is still open and changes omarchy-hw-external-monitors for the same Touch Bar case. Checking the appletbdrm driver here is narrower than skipping USB connectors, and it keeps USB-C displays on Apple Silicon working, so this looks like the better of the two. Linking them so a maintainer can close one.

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Oct 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

This competes with #11516 by @hanscnelson, which fixes the same bug (#10618) and was opened a month earlier. #11516 should be the one that lands, and this one can be closed.

Both fixes skip the Touch Bar's always-connected USB connector in bin/omarchy-hw-external-monitors, and neither breaks the cases around it. This one matches cards bound to appletbdrm. #11516 matches a USB connector whose USB device has Apple's vendor id 05ac. I read both diffs against the kernel's sysfs layout. On a T2 the card's device is the USB interface: its driver is appletbdrm and its parent carries idVendor 05ac, so both checks catch it. USB-C displays on Apple Silicon live on a platform display device with no USB idVendor, so #11516 still counts them. GUD and DisplayLink displays have non-Apple vendor ids, so both fixes still count those too. #11516 also covers T1 Macs, where its author reproduced the bug. @kutassy has confirmed both pull requests on their MacBookPro15,2.

The oldest fix wins unless the newer one is clearly better, and #11516 has no defect that this one avoids. This one adds nothing that needs folding into #11516. So I did not run this branch on a worker again: #11516 is already labelled ready at a33a609.

Codex Medium was given both pull requests and asked which should win, without my answer. It also picked #11516, found no defect in it, and found nothing here worth carrying across. That is agreement, and independence is not guaranteed.

Waiting on the maintainer to merge #11516 and close this one.

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

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

omarchy-hw-external-monitors false positive from tiny-dfr Touch Bar DRM device causes lid-close lock to silently fail (T2 Macs)

2 participants