Skip to content

Add the setup form's XKB layout for keymaps systemd's table lacks - #528

Merged
dhh merged 3 commits into
quattrofrom
xkb-layout-shared-table
Nov 25, 2026
Merged

dhh merged 3 commits into
quattrofrom
xkb-layout-shared-table

Conversation

@bjarneo

@bjarneo bjarneo commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What changes for users

An ISO install with one of these 8 layouts now gets the same layout on the desktop as on the console: Colemak, Bulgarian, Czech, Swiss German, Kyrgyz, Norwegian, Polish and Ukrainian. Today /etc/vconsole.conf gets only KEYMAP for them, so Hyprland and the SDDM greeter type US.

Merge omacom/omarchy#20187 first. It moves the table into setup-form.sh, which this ISO copies onto the image at build time.

The change

  • configure_keyboard runs systemd-firstboot as before. If the result has no XKBLAYOUT, it now adds the lines that omarchy_keymap_xkb_settings in the vendored setup-form.sh prints. First-boot setup in omarchy-provision-owner adds the same lines, so both install paths write the same file.
  • A setup-form.sh without that function adds nothing. An ISO built against an older Omarchy runtime keeps the current behavior.
  • .automated_script.sh explicitly sources /usr/share/omarchy-iso/setup-form.sh before kmscon.sh so kmscon_session has omarchy_keymap_xkb_extra when relaunching kmscon for any of the 8 layouts.
  • uki_vconsole.py and phases_impl.py match omarchy_hooks.conf and omarchy_vconsole.conf for non-Latin leading XKBLAYOUTs: the pre-built UKI refuses to embed them and stays on its US placeholder when baked with us, so Plymouth uses US at the LUKS prompt consistently before and after kernel updates.
  • The module docstring and one test comment named detect-keyboard-layout.sh, which no longer exists. They now name default/hypr/keyboard.lua.

Boot and disk password

For Latin layouts (colemak, cz, de_CH-latin1, no-latin1, pl), _prebuilt_uki_keymap_stale detects the non-US keymap and uki_vconsole.py embeds KEYMAP and XKB* into the pre-built UKI so Plymouth prompts in the chosen layout.

For bg-cp1251, kyrgyz and ua (and other non-Latin layouts like ru), the leading XKBLAYOUT is non-Latin. uki_vconsole.py refuses to embed vconsole.conf and _prebuilt_uki_keymap_stale treats a us-baked pre-built UKI as already matching — matching omarchy_hooks.conf and omarchy_vconsole.conf so the LUKS prompt stays on US both on first boot and after kernel updates.

Testing

OMARCHY_PATH=../omarchy python3 test/unit/test_keyboard.py -v
python3 test/unit/test_uki_vconsole.py -v
python3 test/unit/test_prebuilt_uki_keymap.py -v
bash test/unit/keyboard-selection-test.sh
bash test/unit/keymap-locale-scenario-test.sh
bash test/unit/kmscon-session-test.sh

All pass against omacom/omarchy#20187. FallbackXkbSettingsTest, test_uki_vconsole.py and test_prebuilt_uki_keymap.py also run without localectl or a sibling Omarchy checkout.

systemd-firstboot writes XKBLAYOUT only for keymaps in kbd-model-map. For the
8 form keymaps that are not in it, /etc/vconsole.conf got only KEYMAP, and
Hyprland on the installed system typed US. configure_keyboard now adds the
lines from omarchy_keymap_xkb_settings in the vendored setup-form.sh, as
first-boot setup does. A setup form without that function adds nothing, so
an ISO built against an older runtime keeps the current behavior.
@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The reviewed changes appear safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge.

Summary

Adds missing desktop keyboard settings from the shared setup form.

  • The desktop keeps the chosen keymap when systemd lacks its XKB entry.
  • Non-Latin keymaps keep the pre-built UKI’s US password prompt.

No actionable new issues were found. The external runtime hooks were unavailable, so their agreement with the Serbian Latin exception was not confirmed.

Reviews (3) · Last reviewed commit: "Keep Serbian Latin embedded in pre-built..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Install test passed

x86_64 vs quattro aarch64 vs quattro
Result ✅ passed ✅ passed
Build the ISO 93.0 s +10.0 s 174.0 s +2.0 s
Install 18.7 s +1.2 s 16.3 s −2.1 s
First boot 5.8 s +0.2 s 4.9 s −0.1 s
Everyday boot 6.1 s +0.3 s 4.7 s +0.0 s

Boots are loader, kernel and userspace, without the VM's firmware.

Install phases, x86_64
Phase This PR quattro
Preparing live environment 1.3 s 1.3 s
Preparing install target 7.7 s 7.4 s
Installing Arch + Omarchy 8.1 s 7.3 s
Configuring system 0.6 s 0.5 s
Staging provisioning 0 s 0 s
Finalizing boot and user 0.7 s 0.6 s
Configuring login 0 s 0 s
Configuring SSH access 0.3 s 0.2 s
Configuring Tailscale 0 s 0 s
Configuring DNS resolver 0 s 0 s
Validating boot setup 0 s 0 s
Creating factory snapshot 0.1 s 0.1 s
Install phases, aarch64
Phase This PR quattro
Preparing live environment 1.3 s 1.4 s
Preparing install target 4.7 s 4.7 s
Installing Arch + Omarchy 8.3 s 10.5 s
Configuring system 0.6 s 0.6 s
Staging provisioning 0 s 0 s
Finalizing boot and user 0.8 s 0.8 s
Configuring login 0 s 0 s
Configuring SSH access 0.3 s 0.3 s
Configuring Tailscale 0 s 0 s
Configuring DNS resolver 0 s 0 s
Validating boot setup 0.1 s 0.1 s
Creating factory snapshot 0.1 s 0.1 s

Run · 102eff6

dhh added 2 commits November 25, 2026 22:45
…ts out of the pre-built UKI

- Source /usr/share/omarchy-iso/setup-form.sh before kmscon.sh in
  .automated_script.sh so kmscon_session resolves the 8 extra layouts
  moved into setup-form.sh.
- Match omarchy_hooks.conf and omarchy_vconsole.conf in uki_vconsole.py
  and phases_impl.py so non-Latin leading XKBLAYOUTs (bg, kg, ua, ru, ...)
  are not embedded into the pre-built UKI, keeping Plymouth on US at the
  LUKS prompt consistently before and after kernel updates.
- Guard empty OMARCHY_PATH and no-op writes in keyboard.py, and add
  unit test coverage that runs without localectl or a sibling checkout.
- Make vconsole_is_nonlatin variant-aware for rs(latin*) so Serbian Latin
  (sr-latin) is still embedded in the pre-built UKI instead of falling back
  to US at first boot.
- Clarify log messages in finalize_limine_boot for non-Latin layouts.
- Add unit tests for sr-latin, multi-layout cz embedding, and drift against
  omarchy_hooks.conf.
@dhh
dhh merged commit dead6c4 into quattro Nov 25, 2026
22 checks passed
@dhh
dhh deleted the xkb-layout-shared-table branch November 25, 2026 22:09
emirb added a commit that referenced this pull request Nov 26, 2026
Brings in the hardware layers (#530), the library read before the first
pacman transaction (#531), systemd-boot installs (#489, #529) and the
setup form's XKB layouts (#528).

Two conflicts. In builder/build-root-image.sh both steps stay: the
hardware layers first, which write into the image tree, then the Try
layer against the finished image. In phases_impl.py the hardware layer
paths join the squashfs ROOT_IMAGE and its mount paths.
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.

2 participants