Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion omarchy-mac/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The Mac's hardware data lives in the platform root, `/usr/share/omarchy-platform

- `key-names`: the keybindings menu shows `XF86MonBrightnessUp` and `Down` as the F2 and F1 they are.
- `display-cutouts.json`: the notch of each MacBook panel (the 14" Pro measured at 64 physical rows, the 16" Pro inferred at 64 and the Airs at 56), which the bar keeps clear of. A notched panel not listed gets no floor until the file lists it; `[bar] notch-height` in `shell.toml` only adjusts the floor of a listed panel.
- `displays.conf`: `omarchy-hw-display` never picks the Touch Bar's `display-pipe` or `228600000.dsi.0` backlight and prefers the Retina panel's `apple-panel-bl` (no GPU backlight exists), and `omarchy-brightness-display` probes an external monitor over DDC only when its connector has a `ddc` node, since Apple's display driver registers no DDC channel and a probe would walk the SoC's SMBus for about 3 s.
- `displays.conf`: `omarchy-hw-display` never picks the Touch Bar's `display-pipe` or `228600000.dsi.0` backlight and prefers the Retina panel's `apple-panel-bl` (no GPU backlight exists), and `omarchy-brightness-display` probes an external monitor over DDC only when its connector has a `ddc` node, since Apple's display driver registers no DDC channel and a probe would walk the SoC's SMBus for about 3 s. Its `panel` line has Hyprland send the 14" MacBook Pro panel (eDP, 3024x1964) 10-bit frames in Display P3 (`bitdepth = 10`, `cm = "dp3"`) instead of its 8 bits and sRGB: the display controller takes a 10-bit frame and shows SDR frames in the panel's own gamut, Display P3, so sRGB sent unconverted shows oversaturated; Omarchy's EDID preset maps into the EDID's rounded primaries instead, and switches the connector to BT.2020 where the panel's EDID lists BT.2020 colorimetry. Omarchy gives that panel's monitor rules the settings, never an external monitor's, and a `bitdepth` or `cm` set in `hypr/monitors.lua` wins. The second line covers the 14-inch M5 Max (K114c, eDP 3024x1986): its factory profile is Display P3 at D65, and a `bitdepth = 10` request was not verified on it, so it sets only `cm = "dp3"`. Only the panels listed have been checked on their machines (the M4 J604 at 10 bits, the M5 Max K114c at the default bitdepth); another panel joins once a report shows the same on it. A runtime without the directive ignores the line.
- `audio.json`: the audio panel and microphone widget leave out asahi-audio's DSP internals: the speaker graph's output stream into the raw speakers (`effect_output.jNNN-convolver`, and the desktops' `mini`/`studio`), the microphone graph's always-running capture of the raw array (`audio_effect.jNNN-mic`), the raw devices asahi-audio marks do-not-use (`RawSpeakers`, `RawMics`), the mapper's own capture of the DSP microphone (`input.omarchy_asahi_mic`), which would otherwise count as an app recording, and the mono DSP microphone while the mapper's stereo `omarchy_asahi_mic` exists. A runtime older than the platform root reads no audio hints and keeps its own Apple checks.
- `fingerprint-readers`: Touch ID. `omarchy-hw-fingerprint` finds the sensor once `/run/omarchy-mac/touchid` reads `ready`, or `available` before the owner has turned it on. Nothing loads the Secure Enclave driver until the owner agrees. At boot, `omarchy-mac-touchid-status.service` (`lib/touchid-status`, pulled in by the package's `multi-user.target.wants` link, before the greeter and `fprintd`) asks `lib/touchid-eligibility`, which reads only the device tree and installed files: `available` needs a sensor node, a board the aurora driver has a profile for (M2, M2 Pro and Max, the M3 Air J613 and J615, and the MacBook Neo; M1-family Macs wait for their xART guard path), `/chosen/apfs-preboot-uuid`, a way to the calibration (under the name the sensor's `firmware-name` gives, `apple/mesacal-<board>.bin`, or `apple/mesa_calibration.bin` on M2 Pro and Max) and, on the Neo, a way to the sensor root key, an installed one or the factory records on the ESP with `python` to rebuild it from (the extractors need `python`, which linux-aurora only suggests), and an Omarchy whose `omarchy-lifecycle-dispatch` resolves `enable-fingerprint`, since the invitation comes once and an older setup would enrol a reader nothing turned on; anything else records `unsupported:<reason>`, which no detector line names. Omarchy's fingerprint setup then runs `omarchy-lifecycle-dispatch enable-fingerprint` (`entrypoints/enable-fingerprint`, as root) before enrolling. With no status file (a Mac without a sensor records nothing, and a status service can fail) it works eligibility out again. Where Touch ID can't be set up it lets the setup go on, so a USB reader enrols on a Mac mini, a Studio or an M1 Mac as it would without Touch ID. A Mac whose owner already agreed is never asked again: it gets any missing options and, unless Touch ID reads `ready`, is told to restart, and the setup goes on. It stops the setup only when the owner says no, or turning Touch ID on or writing its options fails. It says in three lines that Touch ID is experimental and can be unstable, that it shares the Secure Enclave with macOS so macOS should be backed up first, and that the Mac manual has the details, then asks. The manual's Encryption and passwords page carries the rest: the key store Linux creates stays, the enclave's anti-replay state moves forward and is one file in the iBoot System Container that macOS updates too, and a bug that writes it wrongly can cost macOS data (with FileVault on, macOS won't start and the Mac needs a DFU restore; with FileVault off, macOS resets its keychain and fingerprints). FileVault's state isn't checked: the owner can change it after installing, so the manual names both cases. On yes, `lib/touchid-enable` carves what is missing from this Mac's own iBoot System Container into `/usr/lib/firmware/updates` (the calibration with linux-aurora's `extract-mesa-calibration`, except on the Neo, whose installer writes the sealed form; the Neo's `apple/msrk-j700.bin`, root-only `0600`, rebuilt with `lib/touchid-root-key`), records the agreement in `/etc/omarchy-mac/touchid-on` and in the driver's options (`/etc/modprobe.d/omarchy-mac-touchid.conf`: `xart_writes=1 provision_keybag=1`, today's defaults, which a kernel that loads `apple_sep` read-only by default, omacom/linux-aurora#180, writes only with; the name sorts after `apple-sep.conf`, so the owner's agreement wins over any `apple-sep.conf`, while `apple_sep.xart_writes=0` on the kernel command line still wins over both, and no initramfs hook includes `apple_sep`, so only the root's copy of the options is read), loads `apple-sep` now (a driver already running keeps the options it loaded with, so on a kernel that loads it read-only, and a Mac with no key store yet, the agreement stands and Touch ID turns on after a restart), and succeeds only once the activation records `ready`, restarting an `fprintd` that started without the reader; a failure after the record is written removes it again, so the next boot offers Touch ID again instead of loading a driver that never came up. A driver that loaded but never came up stays that way until a restart, so the status then reads `failed` and setup doesn't offer Touch ID again that boot; when `/dev/sep-bio` or the keybag never appeared, the activation never ran, and the error points to `journalctl -k`, the driver's own log. While the record exists, `omarchy-mac-touchid-load.service` (pulled in by a `multi-user.target.wants` link) loads `apple-sep` at every boot once `udevadm wait` sees `/dev/disk/by-partlabel/iBootSystemContainer`, since the driver opens that link as it probes and does not retry, and before the greeter and `fprintd`. The wait is part of the service rather than a device dependency, because systemd waits for a unit's devices before it checks its condition: a dependency would hold up every boot, agreed or not, and the greeter on a machine without the partition until the device timed out. A key store from an earlier load (`/var/lib/aurora-sep-keybag.bin`) is not agreement: that owner never saw this text, so they are asked too, told that the existing key store is used. `omarchy-lifecycle-dispatch disable-fingerprint`, after the fingerprints are deleted, removes the record and the options, so the driver stops loading from the next boot and the status offers Touch ID again; the key store stays. A record or options that can't be written, or removed, fails the operation rather than reporting success, and a carved calibration, like the sensor key, takes its name only once it is whole. On a kernel with omacom/linux-aurora#180, udev loads `apple_sep` on every Mac, read-only unless the options file exists, and a read-only driver always reports `matching` as `blocked`. The activation runs only on the owner's record, so a Mac whose owner hasn't agreed, or turned Touch ID off, keeps the boot's `available` and is offered Touch ID; and `enable-fingerprint` writes the options for a Mac agreed before they existed whatever its status, so one that reads `blocked` reaches `ready` after a restart. The Neo's sensor key (`apple/msrk-j700.bin`) is device-private, so nothing reads it before the owner agrees. asahi-installer copies this Mac's factory records (`com.apple.factorydata`) into the ESP's fallback firmware archive, `asahi/all_firmware.tar.gz`, on every install; an image install mounts the ESP at `/boot/efi` with `umask=0077`, so only root can read it there, and that mount is where the archive is read; on yes, `lib/touchid-root-key` (Python's standard library only) reads the `MSRk`, `seal` and trust bundle records from it in memory, rebuilds the key as omarchy-mac-installer's `factory_root_key()` does on macOS (the `MSRk` record's `IM4P` under the FDR sealing manifest, with the trust bundle as `secb`), checks its envelope, and refuses records that aren't all found byte for byte in this Mac's own iBoot System Container, so an archive from another Mac, or one swapped on the ESP, gives no key. It writes the key root-only (`0600`) under a temporary name, synced, then renames it. Nothing is kept when the owner says no, and a yes that then fails to turn Touch ID on takes back the key it rebuilt along with the agreement; `disable-fingerprint` deletes the installed key, and the next yes rebuilds it. A factory reset gives the factory root no key, since the ESP survives it and the next owner's yes rebuilds it. Every Neo install has the archive, since upstream asahi-installer writes it on every install, so none needs the installer to collect the key. A Neo without the archive (removed by hand) or without `python` reads `unsupported:no-root-key`; the boot status looks for the archive, so `omarchy-mac-touchid-status.service` runs after `boot-efi.mount`. Carved files under `/usr/lib/firmware/updates` belong to no package, so a root rollback can remove them. An agreed Mac isn't asked again, so its setup doesn't carve them back: turning Touch ID off (Omarchy's fingerprint removal) and on again does. The two operations, and `available`, need the matching Omarchy change before this file ships. `omarchy-mac-touchid-activate.service` (`lib/touchid-activate`) runs only on the owner's record, so it never opens a driver something else loaded without agreement (fprintd still opens `/dev/sep-bio` when it probes its readers, so on a kernel with omacom/linux-aurora#180, which loads the driver on every Mac, fprintd's allowance for the node needs the same gate first), and writes `/run/omarchy-mac/touchid`, `0644` so the session user can read it, and only when all four of the Secure Enclave driver's `diag` attributes say Touch ID can enrol and match, as the driver's ABI document asks: `touchid` reads `ready`, `sensor_attach` reads `attached`, `restore` reads `restored` or `empty`, and `matching` reads `usable` or `unverified`. `diag/touchid` alone can read `ready` while the sensor is uncalibrated, the enrolled fingerprints are unproven, or the xART guard blocks a match, as on a cold-booting M1-family Mac, and the invitation that follows comes only once. Anything else writes the reason instead (`failed`, `not-ready`, `unproven` or `blocked`) and says why in the unit's journal. Touch ID activates only on the first open of `/dev/sep-bio`, so `94-omarchy-mac-touchid.rules` starts the unit, which opens it once, read-only, as soon as the kernel publishes it; nothing needs enabling. The kernel activates Touch ID inside that open, and activation lasts the rest of the boot after the close. So does a failed activation, so the unit opens the node only once the kernel has made this Mac's keybag, `/var/lib/aurora-sep-keybag.bin`. The node takes one opener at a time, so a node `fprintd` holds is already activated. The attach retries once about 10 s after a short fall, so the script waits until 45 s after it starts for a settled answer, and `TimeoutStartSec=60s` bounds an open that blocks. A missing attribute ends it at once. An update runs it again, and a `ready` from earlier in the boot stands while `sensor_attach` reads `attached`, unless a final failure (`failed`, `unproven` or `blocked`) appears, since `diag/touchid` follows every later bring-up and one can fall short and recover. On the install or update that brings the rule, `/dev/sep-bio` already exists and no add event comes, and the boot-time status unit hasn't run on the update that first installs it, so `90-omarchy-mac-touchid.hook` starts the status unit and then the activation after the transaction, and the same session's post-update check sees the result. On a Mac with no agreement, that status run records `available` and the activation is skipped, whatever loaded the driver, unless Touch ID failed to come up earlier that boot: a reason that failure recorded (`failed`, `not-ready`, `unproven` or `blocked`) stands until a restart, and setup says to restart. The hook is skipped in a chroot, which includes `pacman --root`, or an unbooted root, and never fails the transaction: a unit that fails says why in its journal. The post-update fingerprint invitation then reaches the owner, and the fingerprint setup installs `libfprint-git`, whose aarch64 build carries the Touch ID driver (omacom/omarchy-pkgs#806) and owns `fprintd`'s allowance for `/dev/sep-bio`. systemd resolves that allowance when `fprintd` starts, so the drop-in `fprintd.service.d/50-omarchy-mac-touchid.conf` orders `fprintd` after `omarchy-mac-touchid-wait.service`, which follows the boot-time load, waits up to 15 s for the node where the Secure Enclave driver has a device and returns at once on a Mac without one, and after the activation, so `fprintd` never takes the node while the activation holds it: when both start together, at boot or from the pacman hook, `fprintd` waits for the activation, up to 60 s on a Mac whose attach is still settling. It adds no allowance of its own, and it's inert until Omarchy's setup installs `fprintd`. No sleep hook: the kernel ends a capture before suspend, and on a MacBook Neo the lock screen took the finger on the first touch after resume. Ship this file only once a boot without `aurora-touchid` shows enrolment, verification and suspend working, which still needs: Omarchy's `enable-fingerprint` and `disable-fingerprint` operations and their calls from the fingerprint setup and removal, since `apple-sep` is a module (`APPLE_SEP=m`: built in, it probes before udev has made the iBoot System Container's partition link and fails without retrying) with no modalias, which loads only on the owner's record; and m1n1 that forwards `/chosen/apfs-preboot-uuid`, which selects this install's own lane in the Secure Enclave. Keep that source stable: changing it (boot entries with and without `apple_sep.os_uuid_hi`/`os_uuid_lo`, or a stub reinstall) orphans the Linux enrolments. Without all of that the invitation, which comes once, leads to a setup that cannot finish. The script follows the aurora kernel's naming (the `apple_sep` driver and its `diag` attributes): a kernel that renames them stops the invitation without an error, so move the script together with the kernel pin.
- `keyrings`: `asahi-alarm-keyring`, the signing keyring of the `[asahi-alarm]` repository. `omarchy update` reinstalls every installed keyring this file names, with Arch Linux ARM's, before the system upgrade, so an Asahi key rotation never fails that upgrade's signature checks.
Expand Down
1 change: 1 addition & 0 deletions omarchy-mac/share/omarchy-platform/display-cutouts.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"panels": [
{ "connector": "eDP", "width": 3024, "height": 1986, "top": 96 },
{ "connector": "eDP", "width": 3024, "height": 1964, "top": 64 },
{ "connector": "eDP", "width": 3456, "height": 2234, "top": 64 },
{ "connector": "eDP", "width": 2560, "height": 1664, "top": 56 },
Expand Down
4 changes: 4 additions & 0 deletions omarchy-mac/share/omarchy-platform/displays.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ backlight-skip 228600000.dsi.0
backlight-prefer apple-panel-bl
# DCP registers no DDC channel; a probe would walk the SoC's SMBus for ~3 s
ddc-require-connector-ddc
# The 14" MacBook Pro's panel: 10-bit frames in Display P3 (Hyprland's defaults are 8 bits and sRGB)
panel eDP 3024x1964 bitdepth=10 cm=dp3
# The 14" M5 Max's panel: Display P3 frames (its factory profile is Display P3, D65)
panel eDP 3024x1986 cm=dp3
16 changes: 14 additions & 2 deletions omarchy-mac/test/desktop-setup-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,24 @@ while IFS= read -r line || [[ -n $line ]]; do
[[ -n $argument && -z $extra && $argument != */* && $argument != . && $argument != .. ]] ||
fail "displays.conf: $directive takes one name" "$line" ;;
ddc-require-connector-ddc) [[ -z $argument ]] || fail "displays.conf: $directive takes no argument" "$line" ;;
panel)
read -r mode settings <<<"$extra"
[[ -n $argument && $argument != */* && $argument != . && $argument != .. && $mode =~ ^[0-9]+x[0-9]+$ && -n $settings ]] ||
fail "displays.conf: $directive takes a connector, a mode and settings" "$line"
for setting in $settings; do
[[ $setting =~ ^bitdepth=(8|10)$ || $setting =~ ^cm=(srgb|dp3|dcip3|adobe|wide|edid)$ ]] ||
fail "displays.conf: $directive sets bitdepth (8 or 10) or cm (a Hyprland SDR preset)" "$line"
done
# Only a panel the bar also knows: the same connector and mode as a cutout.
python3 -c 'import json, sys; c, w, h = sys.argv[2], *map(int, sys.argv[3].split("x")); sys.exit(not any(p["connector"] == c and p["width"] == w and p["height"] == h for p in json.load(open(sys.argv[1]))["panels"]))' \
"$platform/display-cutouts.json" "$argument" "$mode" || fail "displays.conf: $directive names a panel display-cutouts.json describes" "$line"
argument="$argument $extra" ;;
*) fail 'displays.conf: unknown directive' "$line" ;;
esac
directives+=("$directive${argument:+ $argument}")
done <"$platform/displays.conf"
[[ ${directives[*]} == 'backlight-skip display-pipe backlight-skip 228600000.dsi.0 backlight-prefer apple-panel-bl ddc-require-connector-ddc' ]] ||
fail 'displays.conf skips the Touch Bar backlights, prefers the Retina panel and probes DDC only where a connector has it' "${directives[*]}"
[[ ${directives[*]} == 'backlight-skip display-pipe backlight-skip 228600000.dsi.0 backlight-prefer apple-panel-bl ddc-require-connector-ddc panel eDP 3024x1964 bitdepth=10 cm=dp3 panel eDP 3024x1986 cm=dp3' ]] ||
fail 'displays.conf skips the Touch Bar backlights, prefers the Retina panel, probes DDC only where a connector has it and runs the 14" MacBook Pro panels in Display P3' "${directives[*]}"
for helper in electron-launchers electron-desktop-entries; do
[[ -x $stage/usr/lib/omarchy-mac/$helper ]] || fail "$helper is staged"
done
Expand Down
2 changes: 1 addition & 1 deletion omarchy-mac/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.6
0.2.8
Loading