Repository navigation
Conversation
The lid-open binding only ran omarchy-hyprland-monitor-clamshell. After a longer suspend that left the internal panel black on hardware where ACPI backlight restore is slow or incomplete, while the idle wake path already turned the display back on and restored the keyboard backlight via omarchy-system-wake. Point switch:off:Lid Switch at omarchy-system-wake so lid open gets the same restore sequence, then the same clamshell reconciliation wake already performs. Update monitor-recovery-test to assert the binding and the wake steps. Fixes #9628 Signed-off-by: fresh3nough <anonwurcod@proton.me>
The comment blamed slow ACPI backlight restore, but omarchy-system-wake restores no backlight level: it enables DPMS. Played on a worker, the panel stays off after a lid open because the lock screen turned DPMS off five seconds after locking and the old binding never turned it back on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed and run on an Omarchy worker VM, with a second opinion from Codex Medium. The fix works. I reproduced #9628 on a worker by locking the session, letting the lock screen blank the panel, then sending a lid close and open through a uinput Pushed: 2e1673f rewrites the comment above the binding. The old comment blamed slow ACPI backlight restore, but Two side effects, both found by Codex Medium and checked against the code. Neither is a quick fix, because each changes what lid open is meant to do:
Waking through the lock screen when the session is locked, and running the clamshell reconciliation only when it is not, would avoid both. The lock screen has no IPC entry point for that today, though, so it is a design choice for the maintainer rather than a defect to patch here. Related: #12210 also points lid open at This is verified and waiting on the maintainer to decide whether those two side effects are acceptable as they stand. |
|
| o.bind("switch:on:Lid Switch", nil, "omarchy-system-lid-close", { locked = true }) | ||
| o.bind("switch:off:Lid Switch", nil, "omarchy-hyprland-monitor-clamshell", { locked = true }) | ||
| -- The lock screen powers the panel off after locking, so opening the lid has to wake it, not just reconcile clamshell. | ||
| o.bind("switch:off:Lid Switch", nil, "omarchy-system-wake", { locked = true }) |
There was a problem hiding this comment.
Lid open changes keyboard brightness
When a docked laptop’s lid closes, it does not lock or turn off the keyboard backlight. Opening it now runs omarchy-system-wake, which restores a brightness value saved during an earlier lock. If the user changed the keyboard brightness since then, opening the lid overwrites their current setting.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| grep -F 'omarchy-brightness-display on' "$system_wake" >/dev/null | ||
| grep -F 'omarchy-brightness-keyboard restore' "$system_wake" >/dev/null | ||
| grep -F 'omarchy-hyprland-monitor-clamshell >/dev/null 2>&1 || true' "$system_wake" >/dev/null | ||
| pass "system wake resyncs clamshell display state" | ||
| pass "system wake restores display and keyboard brightness then resyncs clamshell" |
There was a problem hiding this comment.
These checks only confirm that each command appears somewhere in the wake script. The test would still pass if the commands ran in a different order, despite claiming to verify that display and keyboard wake happen before clamshell reconciliation. An ordered assertion or a test using stubbed commands would catch that regression.
|
One thing from real hardware that the VM repro can't show: after an actual suspend, a single On a MacBookPro14,3 (Omarchy 4.0.4, s2idle), I measured
So the lock service's post-resume blank (the frozen displays_on() { hyprctl monitors -j | jq -e '[.[] | select(.disabled == false)] | length > 0 and all(.dpmsStatus)' >/dev/null; }
for _ in $(seq 1 16); do
omarchy-hw-laptop-closed && exit 0
displays_on || omarchy-system-wake >/dev/null 2>&1
sleep 0.5
done |
quattro added an Apple SMC lid switch beside the ACPI one, bound to the same clamshell-only command this branch replaces. The lock screen blanks the panel the same way on either machine, so both lid-open bindings now run omarchy-system-wake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch no longer merged into Re-run on an Omarchy worker at 693d54a. I locked the session, waited for the lock screen to turn DPMS off, then sent a lid close and open through a uinput device. I did this once under each switch name. On the head the panel comes back on. With the fix reverted, which leaves the bindings exactly as @niconistal, thanks for measuring this on real hardware. I could not reproduce it on a worker, because a QEMU worker never comes back from s2idle. Codex Medium traced one path in the source that matches what you saw. If the machine suspends within the lock screen's 5-second run-up, @BjornB2, since #9628 is yours, could you try this on the MacBook10,1? Run Reviewed by Claude Opus 5.5, with Codex Medium as the second opinion on the merged head. Codex found the frozen-countdown path above and agreed that the merge resolution and the Apple SMC binding are right. Its independence is not guaranteed. This is verified for a lid open without suspend. It now waits on that test from @BjornB2, then on the maintainer's call on the side effects. |
Summary
After suspend, opening the laptop lid only ran
omarchy-hyprland-monitor-clamshell. That reconciles internal/external monitor state but does not turn the panel backlight back on or restore the keyboard backlight.The idle wake path already does the full restore via
omarchy-system-wake:On hardware where ACPI backlight restore is slow or incomplete (reported on MacBook10,1 in #9628), lid open left a black internal panel until a power-button press, while idle wake recovered cleanly.
Fix
Point
switch:off:Lid Switchatomarchy-system-wakeso lid open gets the same restore sequence, then the same clamshell reconciliation wake already performs. Close path is unchanged (omarchy-system-lid-close).Tests
test/shell.d/monitor-recovery-test.sh— binding now expectsomarchy-system-wake; asserts wake restores display + keyboard brightness before clamshelltest/shell.d/lid-close-test.sh— still passes (close path untouched)test/shell.d/monitor-clamshell-scale-test.sh— still passesFixes #9628