Skip to content

Lock on Apple Silicon SMC lid close - #13661

Closed
AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:cursor/fix-apple-smc-lid-close-ef3e
Closed

AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:cursor/fix-apple-smc-lid-close-ef3e

Conversation

@AnPod

@AnPod AnPod commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes omacom/omarchy#13370: Asahi exposes the lid as Apple SMC power/lid events. Without a binding through omarchy-system-lid-close, lock/suspend never starts.

Changes

  • Bind SMC lid close → omarchy-system-lid-close
  • Bind SMC lid open → omarchy-hyprland-monitor-clamshell

Test plan

  • ./test/shell.d/monitor-recovery-test.sh

Asahi exposes the lid as Apple SMC power/lid events. Bind close through
omarchy-system-lid-close so lock and suspend still begin.

Co-authored-by: AnPod <AnPod@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-apple-smc-lid-close-ef3e branch from e368371 to 84db519 Compare September 29, 2026 21:13
@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this. I'm closing it as a duplicate of #12693, which is older, targets quattro as well, and adds the same two binds byte for byte: switch:on:Apple SMC power/lid events → omarchy-system-lid-close and switch:off:Apple SMC power/lid events → omarchy-hyprland-monitor-clamshell, both { locked = true }. It also carries a device listing from an M1 showing that name. If I've misread the two as the same change, this can be reopened.

Two things I found while comparing them also apply to #12693, so they're worth knowing here:

  • The binds alone don't make a lid close lock. bin/omarchy-system-lid-close:16 locks only when omarchy-hw-laptop-closed says the lid is closed, and that helper reads only /proc/acpi/button/lid/*/state, which doesn't exist on Apple Silicon. I ran omarchy-system-lid-close at this head on a worker with no ACPI lid and stubbed the lock and clamshell commands. It called the clamshell reconcile and never asked for the lock. omarchy-hw-clamshell depends on the same helper, so clamshell mode doesn't engage either. Read the lid from logind so clamshell works without an ACPI lid button #7951 reads the lid from logind instead, and it is the other half of this fix.
  • The root cause given in Apple Silicon lid close binds wrong command — machine never suspends #13370 isn't in the code. No branch has an existing Apple SMC bind pointing at the wrong command; quattro binds only Lid Switch. A missing Hyprland bind also doesn't stop suspend, because logind suspends on the lid through its own evdev handling, and omarchy-system-sleep-lock locks on PrepareForSleep. The comment this PR adds ("so suspend still begins") describes something the bind doesn't do.

What I checked: I read the diff against quattro and ran test/shell.d/monitor-recovery-test.sh and test/shell.d/lid-close-test.sh on a worker at 84db5192b64adae98d5977b6ca72336bc5355e52 (both pass). The added assertions only grep for the bind strings, so they pass whether or not the lid ever locks. Codex Medium reviewed it as a second opinion and reached the same two conclusions from the source; its independence from my review isn't guaranteed. It also pointed out that omarchy-hw-laptop is ACPI- or DMI-only, which keeps the docked clamshell poll from starting on that hardware.

#12693 and #7951 are with the maintainer.

@omarchybot omarchybot added the duplicate This issue or pull request already exists label Oct 3, 2026
@omarchybot omarchybot closed this Oct 3, 2026
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! duplicate This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apple Silicon lid close binds wrong command — machine never suspends

3 participants