Skip to content

Name the whole Apple top row in the keybindings menu - #717

Closed
briantoll wants to merge 1 commit into
omacom:quattrofrom
briantoll:fix/menu-apple-fn-row
Closed

briantoll wants to merge 1 commit into
omacom:quattrofrom
briantoll:fix/menu-apple-fn-row

Conversation

@briantoll

Copy link
Copy Markdown

Problem

#215 made Shift+F1/F2 show as the keys you press, but the rest of the Apple top row still leaks raw keysyms into Super+K. On a stock quattro install here, 28 rows read XF86AudioMute, XF86AudioRaiseVolume, XF86AudioMicMute, XF86AudioPlay…, including the fork's own SUPER + XF86AudioMute → Screenshot Window (Apple top row) binds that exist precisely because the Mac keyboard sends those symbols.

Why these names are right

Asahi's hid-apple routes built-in keyboards (BUS_SPI/BUS_HOST) through magic_keyboard_2021_and_2024_fn_keys, and fnmode=1 (what the fork sets) makes the media function the bare press:

Key keysym
F1 / F2 XF86MonBrightnessDown / Up (already handled by #215)
F3 XF86LaunchA (Mission Control)
F4 XF86Search (Spotlight)
F5 XF86AudioMicMute (dictation)
F6 XF86Sleep (Do Not Disturb)
F7 / F8 / F9 XF86AudioPrev / XF86AudioPlay / XF86AudioNext
F10 XF86AudioMute
F11 / F12 XF86AudioLowerVolume / XF86AudioRaiseVolume

(xkb's evdev keycode map confirms the keysym for each KEY_* code.) The only exception in the driver is the 13" MacBook Pro 2020/2022 with a Touch Bar, which has no physical F row at all; the menu's F-key names are no worse there than today's F1/F2.

Change

  • parse_keycodes() renames the full row from a table, matched on whole symbols (\<…\>), so e.g. XF86AudioPlay never touches another symbol and keysyms the built-in keyboard does not have (XF86Calculator, XF86Eject, XF86KbdBrightness*, XF86Touchpad*, XF86PowerOff) keep their names.
  • Render cache version bumped (v14 → v15) so existing caches re-render.
  • test/shell.d/menu-keybindings-fkeys-test.sh extended with rows for F3, F5, F6, F8 and F10 and a non-Apple keysym that must stay raw.

Verified

MacBook Pro 14" M1 Max (j314), live hyprctl binds: omarchy-menu-keybindings --print now shows SUPER + F10 → Screenshot Window (Apple top row), F5 → Mute microphone, SHIFT + F8 → Switch media source, F11 → Volume down, and so on; menu-keybindings-fkeys-test, keybindings-menu-test and menu-test pass; omarchy commands --check passes.

One thing left visible, deliberately out of scope: rows bound to the real F-keys (SUPER + F10 → Screenshot Window, voxtype's F9) now sit next to their media-key twins. Under fnmode=1 those need Fn held, so a follow-up could render them as FN + F10 on Apple keyboards.

Fixes #194

🤖 Generated with Claude Code

On Apple Silicon MacBooks the built-in keyboard sends media keysyms for the
top row: the hid-apple table for 2021 and later Apple keyboards maps
F1..F12 to brightness, Mission Control, Spotlight, dictation, Do Not
Disturb, previous/play/next, mute and volume, and fnmode=1 makes that the
bare press. omacom#215 renamed the two brightness keys so Shift+F1/F2 showed as
the keys you press, but the rest of the row still leaked as raw symbols:
28 rows read XF86AudioMute, XF86AudioRaiseVolume, XF86AudioMicMute and so
on, including the fork's own "Screenshot ... (Apple top row)" binds.

Extend the renaming to the full row (F3 XF86LaunchA, F4 XF86Search, F5
XF86AudioMicMute, F6 XF86Sleep, F7-F9 XF86AudioPrev/Play/Next, F10
XF86AudioMute, F11/F12 XF86AudioLowerVolume/RaiseVolume), matched on whole
symbols so nothing else is touched, and bump the render cache version.
Keysyms the built-in keyboard does not have (XF86Calculator, XF86Eject,
XF86KbdBrightness*, XF86Touchpad*) keep their names.

Verified on a MacBook Pro 14" M1 Max against the live binds: "SUPER +
XF86AudioMute -> Screenshot Window (Apple top row)" now reads "SUPER +
F10", "XF86AudioMicMute -> Mute microphone" reads "F5".

Fixes omacom#194

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@elmarculino

Copy link
Copy Markdown

Data point from a MacBook Air M4 (J713) running the community Omarchy-M4-Native port on official Omarchy 4.5.0-2 (not this fork): the problem is still present upstream. omarchy menu keybindings --print lists 32 rows with raw keysyms, e.g.:

ALT + XF86AudioLowerVolume          → Volume down precise
ALT + XF86AudioRaiseVolume          → Volume up precise
ALT + XF86MonBrightnessUp           → Brightness up precise

So this looks worth carrying regardless of what upstream does next.

@briantoll

Copy link
Copy Markdown
Author

Replaced by omacom/omarchy-mac-pkgs#105, which puts the names in the platform key-names file that mainline Omarchy reads instead of hard-coding them in the menu script.

@briantoll briantoll closed this Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Keybindings Menu to show Omarchy Mac specific keybindings clearly

2 participants