Repository navigation
Conversation
Omarchy binds screenshots to Print and the keyboard backlight to XF86KbdBrightness, and an Apple Silicon MacBook's keyboard has neither key. A udev hwdb remap for the built-in keyboard only (Apple SPI on M1, Apple MTP on M2 and later) turns F4 into Print and F5/F6 into keyboard backlight down/up, so Omarchy's own binds work with no Mac-specific Hyprland binds. The first boot-time display unit also drops its ordering on omarchy-drive-recover.service, which no longer exists. Implements omacom/omarchy-mac#683.
|
Tested on M2 hardware: 14" MacBook Pro M2 Max (j414c), kernel 7.1.12-2-11.31-sep-ARCH. The hwdb was loaded from
Two things to weigh:
Not tested: M1 ( |
omarchy-mac's main ships no remap for the missing keyboard-light keys yet: it is tracked in omacom/omarchy-mac#683, and the hwdb remap is only the draft omacom/omarchy-mac-pkgs#6. Drop 90-m4-keyboard.hwdb and its test, so the J616s keyboard behaves as omarchy-mac does today. The SHIFT + brightness rebind stays gone: SHIFT + F1/F2 are Omarchy's display minimum/maximum.
scottjones
left a comment
There was a problem hiding this comment.
We went through this again against current main. It still merges cleanly, and omarchy-mac/test/all, omarchy-mac-boot/test/all and the new keyboard-keys-test.sh pass on the merged tree. The new test catches what it should: dropping the MTP line, changing a key, widening the match to Apple* or removing the file each make it fail.
Tested on M3 hardware: 13" MacBook Air M3 (J613), linux-aurora 7.2.11.aurora8-1. We installed the hwdb from 99fac5c in /etc/udev/hwdb.d, then ran systemd-hwdb update and udevadm trigger.
- The built-in keyboard is
Apple MTP keyboard, as on M2, so the existing match covers it. The backlight LED iskbd_backlight(max 255) and lights withbrightnessctlbefore the remap. - Before: without Fn, F4/F5/F6 report
MSC_SCAN7003d/7003e/7003fand sendKEY_SEARCH,KEY_MICMUTEandKEY_SLEEP, the same as M2. We didn't capture the Fn presses. - After: F5 and F6 dim and brighten the keyboard light, and F4 opens Omarchy's screenshot tool.
The README and description could name the M3 Air next to M2 as tested. "M2 and later" in omarchy-mac/README.md:53 already covers it.
Still open from our M2 Max run:
-
omarchy-mac/README.md:53says the remap applies from the next boot orudevadm trigger, but nothing goes back onudevadm trigger. After removing the package, or a later version that drops a key, the kernel keeps the old codes until the keyboard is re-created (a reboot). We'd add a line saying a reboot is needed after removal or a dropped key. -
F5 is a working mic-mute key today, and with this change it becomes backlight down. That's a choice, not a bug, but it should be a deliberate one. If we keep it, we'd mention in the README that the mic key is gone on the built-in keyboard.
-
Fn+F4 to F6 no longer send F4 to F6 on the built-in keyboard, as the description says. A hwdb remap can't tell Fn apart (the scan code is the same either way), so this comes with the approach. README:53 says they send these with or without Fn; worth saying outright, next to the fnmode section, that F4 to F6 are gone as F-keys on the built-in keyboard.
Small ones: on main, omarchy-mac/README.md:23 points at this PR as "in review", and README.md:38 describes the moon key as KEY_SLEEP for the logind drop-in from #4. With this PR F6 on the built-in keyboard is backlight up, so that line should say so (the drop-in still matters for other keyboards or after removal).
The omarchy-drive-recover.service cleanup in omarchy-mac-external-displays.service looks right: nothing else on main ships or references that unit.
M1 (Apple SPI Keyboard) is still untested.
Implements omacom/omarchy-mac#683. Omarchy binds screenshots to Print and the keyboard backlight to
XF86KbdBrightness*; a MacBook keyboard has neither key. A udev hwdb remap for the built-in keyboard only (Apple SPI Keyboardon M1,Apple MTP keyboardon M2+) makes F4 Print and F5/F6 keyboard backlight down/up, so Omarchy's own binds work with no Mac Hyprland binds.Also drops
omarchy-mac-external-displays.service's ordering onomarchy-drive-recover.service, which no longer exists (#683's cleanup list).Draft until checked on hardware. Not yet verified:
7003d-7003f) and evdev names the M1 and M2 keyboards report (evtest/libinput debug-events, with and without Fn);hid_apple's Fn translation leaves the remapped keys alone. As written, the three keys send Print/backlight with or without Fn, so F4-F6 are lost as F-keys on the built-in keyboard;F6 overlaps #4 (moon key, from omacom/omarchy-mac#646).
Tested: new
omarchy-mac/test/keyboard-keys-test.shcompiles the hwdb withsystemd-hwdb --rootand checks that only the built-in keyboard names match.omarchy-mac/test/allandomarchy-mac-boot/test/allpass in an ALARM aarch64 container.