Skip to content

Display, notch and ambient light on the converged stack - #533

Merged
maralcbr merged 12 commits into
quattro-upstreamfrom
mac/39-display
Sep 25, 2026
Merged

maralcbr merged 12 commits into
quattro-upstreamfrom
mac/39-display

Conversation

@maralcbr

Copy link
Copy Markdown
Member

Ticket 39 of the Apple Silicon convergence plan (display, notch and ambient light). Stacked on #514 (mac/13-hw-platform); every new gate goes through omarchy-hw-apple-silicon, which wraps omarchy-hw-platform.

What changed

  • Greeter waits for the display controller (gap audit D7, from mx-mac). omarchy-mac ships an sddm.service drop-in that holds the greeter until apple-drm has replaced simpledrm, for at most 10 s and never fatal. Without it a greeter that starts early draws to a dead output and the password field never fills in.
  • Greeter keeps keyboard focus when late displays open login windows (D8, mx-mac Lock on bootup #109). Core default/sddm/hyprland.lua; platform-neutral, so an upstream candidate.
  • Software cursor on every Apple Silicon Mac (D1). omarchy-mac-setup-user writes it once into looknfeel.lua, keeping an existing cursor setting or a later removal. The core Electron leaf stops writing its no-GPU-only cursor block, and a migration runs the user setup for existing Macs.
  • No DDC probe on Mac externals without a DDC channel (triage fix(brightness): skip DDC when the connector has no ddc node #491, detector-gated variant). apple-drm has no ddc node, so each brightness key cost ~3 s of SMBus probing. On a Mac such a monitor now fails at once instead of probing or dimming the built-in panel. x86 and other aarch64 machines are unchanged.
  • Ambient-light keyboard loop relights keys left off (triage fix(brightness): resume keyboard ALS after an off leftover #486, reworked). The brightness keys now record each level they set. An LED at 2% or less that the keys did not set, such as a lock blank, a restored 0 or a leftover, no longer pauses the loop. Keys turned off with the brightness keys still stay off until the room changes enough.

Already on quattro-upstream and left as is: the notch strip (appledrm show_notch=1, which the Aurora kernel on the M2 Max also exposes), the apple-panel-bl choice in omarchy-hw-display, the ALS loop itself and natural scrolling.

Not in this PR: #340 (idle-off and config file) is an optional feature to rebase on top. #463 needs rework beyond this ticket: libinput ignores its /etc/libinput/*.quirks path, and the M2 Max kernel already reports the pad size (ID_INPUT_WIDTH_MM=157, HEIGHT_MM=96), so AttrSizeHint would not apply.

Testing

  • New tests: the greeter wait (fixture device tree and card, including a card that appears late), the greeter focus Lua (late outputs, a prompt the user already chose, desktop fallback, bounded polling), the software cursor setup and its migration, the Mac DDC cases, and the ALS loop driven by the real brightness command through lock blank, wake restore, a deliberate off and a lux change. Each new test fails on the base branch.
  • ./test/shell as non-root in an aarch64 Omarchy container: 286 pass. The 9 failures also fail on the base branch in the same container (missing omarchy-pkgs checkout, ffmpeg, xkbcli, mise). ./test/cli and packages/omarchy-mac/test/all pass.
  • M2 Max (mx-mac stack, Aurora 7.1.12), read-only: the controller card path, no ddc nodes on apple-drm connectors, apple-panel-bl, kbd_backlight, aop-sensors-als and the show_notch parameter all match what the code expects. Behaviour on the converged image is still unverified; tickets 25 and 51 run the hardware check.

Second review: four rounds. Three stale-record cases in the keyboard loop and test-style points were fixed. The loop now forgets a key-set level whenever it writes the LED itself. Remaining finding, pre-existing and outside this diff: cancelling idle before the lock runs omarchy-system-wake, which restores the last lock's saved keyboard level even if it is days old.

simpledrm registers a card about 0.1 s into boot and apple-drm replaces it
about 3 s later. A greeter that starts in between keeps drawing to an output
that no longer scans out, so the password field never fills in. omarchy-mac
now ships the mx-mac wait as an sddm drop-in, gated on the platform detector
and the display-subsystem node, bounded at 10 s and never fatal.
SDDM opens one login window per output and only the focused one takes
keystrokes. Displays that register after the first window (USB-C monitors
on a Mac) opened windows that stole focus or left none focused. New greeter
windows no longer take initial focus; a bounded timer picks the built-in
panel's window, or the first output's on desktops, and keeps a prompt the
user already chose. Greeter gaps and borders go so the login fills its
display. From mx-mac #109; platform-neutral.
A hardware cursor plane on Apple's display controller makes every pointer
update a round trip into its firmware, so the pointer lags the hand. The
user setup only switched it off on Macs without a render GPU, which the
Aurora and Asahi kernels both have. omarchy-mac-setup-user now writes the
software cursor once on every Mac, keeping an existing cursor setting or a
later removal, and a migration runs it for existing users.
apple-drm registers no per-connector ddc node, so every brightness key on a
Mac external monitor (and every read on a Mac mini) probed the SoC's SMBus
for about 3 s, changed nothing and filled the journal. On Apple Silicon an
external monitor now needs that node before ddcutil runs; without it the
command fails at once rather than dimming the built-in panel. Other
platforms probe as before. Adapted from omarchy-mac #491.
The ambient light loop paused on any LED change, so a lock blank that was
never restored, a restored 0 or a 1% leftover kept the keys dark in a dark
room until the light changed a lot. The keyboard-brightness command now
records each level it sets; an LED at 2% or less that it did not set counts
as left off and the loop resumes. Keys turned off with the brightness keys
still pause until the room changes enough. Reworks omarchy-mac #486.
A leftover relit after a deliberate off kept the old record, so the next
lock blank looked deliberate and the keys stayed dark.
A loop restarted after a deliberate off takes the keys back but kept the
record, so the next lock blank looked deliberate. Starting, like resuming,
now clears it.
A press that left the LED unchanged kept its record through later automatic
changes. One rule replaces the start and resume cases: once auto writes a
level, the hand-set record is stale.
A regression that relit every hand-set off made the step-down loop spin
forever instead of failing.
@maralcbr
maralcbr changed the base branch from mac/13-hw-platform to quattro-upstream September 25, 2026 09:44
# Conflicts:
#	packages/omarchy-mac/ORIGINS.md
#	packages/omarchy-mac/README.md
@maralcbr
maralcbr merged commit 5cb89b9 into quattro-upstream Sep 25, 2026
5 checks passed
maralcbr added a commit that referenced this pull request Sep 25, 2026
Brings in the password sync (#532), audio (#535), display (#533), Wi-Fi
resume (#529) and battery charge limit (#525) work.

omarchy-drive-password takes #532's version. It already carries what #503
added (no tracing, the new password over stdin), and it has no Apple branch.
#503's drive-password-apple-test.sh asserted that the disk password never
changes the login or root password, which ticket 19 replaced with a
journaled LUKS-first sync for the system disk; drive-password-test.sh covers
the shared behaviour, so the Apple copy goes.
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.

1 participant