Repository navigation
Stop the DMI chassis fallback in omarchy-hw-laptop reading an empty string - #7948
chubuntuarc wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Independent confirmation on different hardware: MacBookPro18,3 (M1 Pro), Asahi, kernel 7.1.6-1-1-ARCH, Omarchy 4.0.2-mac.1 ( Same result as your M2 Air — One thing worth having in the record for whoever triages this, because it is not visible from either PR alone: this fix and the
That combination also produces a symptom that is confusing in isolation: patch only the lid state and the daemon reconciles against its own stale Verified locally with both fixes applied, physical lid close while docked to an external display: eDP-1 holds off across the reconciliation passes instead of flapping, and the session correctly neither locks nor suspends while docked. Filed #10477 for this before finding the PR; closing it as covered by this. |
|
Confirming this is still live on Machine: MacBookPro17,1 (M1), Asahi, aarch64. No ACPI lid button, so the DMI fallback is the only branch that can answer. $ printf '[%s]\n' "$(< /sys/class/dmi/id/chassis_type)"
[9]
$ printf '[%s]\n' "$(< /sys/class/dmi/id/chassis_type 2>/dev/null)"
[]
$ omarchy-hw-laptop; echo $?
1
Downstream effect, since the helper is a guard: Worth noting this is a separate helper from |
|
Reviewed and verified at 1ce5923; nothing found that needs changing. Reproduced on an Omarchy worker VM, which has no ACPI lid button, with Second opinion from Codex Medium agreed the bug is real and the fix is correct and proportionate (independence not guaranteed). It added one point worth recording: Waiting on the maintainer. |
|
Closing as out of scope: Omarchy now supports only installs made from the official Omarchy ISO, and this change exists for Apple Silicon, which the ISO doesn't produce. We aren't taking on code paths for setups outside that, because nobody here can test or maintain them. The community-maintained omarchy-mac project is the place for Apple Silicon work. Thanks for the work that went into this. (Checked by Claude Opus 5.5; no second review.) |
omarchy-hw-laptopfalls back to the DMI chassis type when the machine exposes no ACPI lid button, but the fallback can never match. Bash only treats$(< file)as "read this file" when the substitution holds that one redirection and nothing else; adding2>/dev/nullturns it into a null command with two redirections, whose stdout is empty.So the
casealways compares the empty string, and every laptop that reaches the fallback exits 1. On x86 the ACPI loop above answers first, which is what has kept this invisible: only hardware with no/proc/acpiat all falls through. Apple Silicon under Asahi is such a machine —hostnamectl chassissayslaptopand/sys/class/dmi/id/chassis_typeholds9, yetomarchy-hw-laptopreports that this is not a laptop.Everything gated on the command is silently off there.
Laptop Display,Mirror Display, andBattery Percentageall carry"when": "omarchy-hw-laptop"indefault/omarchy/omarchy-menu.jsonc, andomarchy-hyprland-monitor-watch:78skips itsomarchy-hw-laptop && omarchy-hyprland-monitor-external-activebranch.catkeeps the error suppression the original form was reaching for. After this change no$(<in the tree carries an extra redirection.Tested on a MacBook Air M2 (J413) running Asahi Arch:
bin/omarchy-hw-laptopgoes from exit 1 to exit 0, matchinghostnamectl chassis../test/all— 188 of 190 test files pass. The two failures,bar-icon-geometry-test.shandsnapper-test.sh, fail identically on a clean checkout on this machine and are unrelated to this change: a bar icon is painted 0.59 px off center, and the Snapper suite wants a siblingomarchy-isocheckout that isn't present.