Skip to content

Share the console keymap XKB table through the setup form - #20187

Merged
dhh merged 2 commits into
omacom:quattrofrom
bjarneo:share-console-keymap-xkb-table
Nov 25, 2026
Merged

dhh merged 2 commits into
omacom:quattrofrom
bjarneo:share-console-keymap-xkb-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 these installs type US in Hyprland and in the SDDM greeter.

The ISO half of the fix is omacom/omarchy-iso#528. This PR comes first, because the ISO reads the table from setup-form.sh.

Why it happens

The ISO writes /etc/vconsole.conf with systemd-firstboot --keymap=<keymap>. systemd-firstboot writes XKBLAYOUT only for keymaps in /usr/share/systemd/kbd-model-map, and these 8 form keymaps are not in it. default/hypr/keyboard.lua reads XKBLAYOUT from /etc/vconsole.conf, so it falls back to us.

First-boot setup already adds the missing lines with keyboard_xkb_settings in bin/omarchy-provision-owner. Moving the table and line printer into setup-form.sh keeps them alongside OMARCHY_KEYBOARD_LAYOUTS so the ISO, first-boot setup, kmscon.sh and Setup > Keyboard all share one source of truth.

The change

  • install/provisioning/setup-form.sh now holds the table as omarchy_keymap_xkb_extra and the line printer as omarchy_keymap_xkb_settings. Both moved without a change in their output.
  • bin/omarchy-provision-owner calls omarchy_keymap_xkb_settings. kmscon.sh reads omarchy_keymap_xkb_extra from setup-form.sh, sourcing its sibling setup-form.sh if the caller has not already so standalone callers stay self-contained.
  • default/input-methods/typing_setup.py reads the table from setup-form.sh instead of its own copy. That copy had 6 of the 8 entries. The Setup > Keyboard catalog is identical before and after, with 48 entries.

Disk password prompt

For bg-cp1251, kyrgyz and ua, the first XKB layout is non-Latin. etc/mkinitcpio.conf.d/omarchy_hooks.conf and omarchy_vconsole.conf keep vconsole.conf out of the initramfs, and the companion ISO PR keeps them out of the pre-built UKI as well, so the LUKS prompt uses US — matching Russian ISO installs (ru -> ru,us). The other 5 keymaps are Latin, so the initramfs and pre-built UKI carry vconsole.conf as before.

Not in this PR

Machines that are already installed keep their /etc/vconsole.conf. They stay on US until the user picks a layout under Setup > Keyboard > Keyboard Inputs or sets kb_layout in ~/.config/hypr/input.lua.

Testing

The coverage check in test/shell.d/provision-owner-keyboard-test.sh looks up each form keymap in setup-form.sh alone, from a clean shell, the way the ISO does, and verifies kmscon.sh resolves extra keymaps when sourced on its own.

bash test/shell.d/provision-owner-keyboard-test.sh
bash test/shell.d/setup-form-test.sh
bash test/shell.d/input-method-test.sh
OMARCHY_PATH=$PWD python3 test/shell.d/typing-setup-checks.py

All 4 pass. The ISO's test/unit/test_keyboard.py also passes against this branch.

The ISO writes /etc/vconsole.conf with systemd-firstboot. systemd-firstboot
adds XKB lines only for keymaps in kbd-model-map, and 8 installer layouts are
not in that table: Colemak, Bulgarian, Czech, Swiss German, Kyrgyz,
Norwegian, Polish and Ukrainian. After an ISO install with one of them, the
console uses the chosen keymap, but Hyprland and the SDDM greeter type US.

First-boot setup already adds the missing lines from its own table. The ISO
reads only setup-form.sh, so the table and the helper that prints the
vconsole.conf lines move into that file as omarchy_keymap_xkb_extra and
omarchy_keymap_xkb_settings. omarchy-provision-owner, kmscon.sh and
Setup > Keyboard now read this one table, and the copy in typing_setup.py
is removed.
@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable new issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issues were found.

Summary

Shares the extra console-to-XKB mappings through setup-form.sh for the ISO, owner setup, and keyboard picker.

  • New installs share the selected keymap with the desktop.
  • Setup > Keyboard builds its catalog from the shared keymap table.

No actionable new issues were found. No previous review threads were supplied. Tests were not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A["setup-form.sh: shared XKB table"] --> B["Owner setup: vconsole.conf"]
  A --> C["kmscon.sh: console layout"]
  A --> D["typing_setup.py: keyboard choices"]
  A --> E["ISO companion change"]
Loading

Reviews (2) · Last reviewed commit: "Keep kmscon.sh self-contained when sourc..." · Reviewed by Greptile

Have kmscon.sh source its sibling setup-form.sh when omarchy_keymap_xkb_extra
is not already defined, so callers that source kmscon.sh directly (including
the ISO's .automated_script.sh) keep resolving the extra console keymaps
instead of silently falling back to US.

Also guard against empty leading variants in typing_setup.py's xkb_choice.
@dhh
dhh merged commit f989b43 into omacom:quattro Nov 25, 2026
8 of 10 checks passed
cursor Bot pushed a commit to mark-groves/omarchy that referenced this pull request Nov 25, 2026
* Share the console keymap XKB table through the setup form

The ISO writes /etc/vconsole.conf with systemd-firstboot. systemd-firstboot
adds XKB lines only for keymaps in kbd-model-map, and 8 installer layouts are
not in that table: Colemak, Bulgarian, Czech, Swiss German, Kyrgyz,
Norwegian, Polish and Ukrainian. After an ISO install with one of them, the
console uses the chosen keymap, but Hyprland and the SDDM greeter type US.

First-boot setup already adds the missing lines from its own table. The ISO
reads only setup-form.sh, so the table and the helper that prints the
vconsole.conf lines move into that file as omarchy_keymap_xkb_extra and
omarchy_keymap_xkb_settings. omarchy-provision-owner, kmscon.sh and
Setup > Keyboard now read this one table, and the copy in typing_setup.py
is removed.

* Keep kmscon.sh self-contained when sourced without setup-form.sh

Have kmscon.sh source its sibling setup-form.sh when omarchy_keymap_xkb_extra
is not already defined, so callers that source kmscon.sh directly (including
the ISO's .automated_script.sh) keep resolving the extra console keymaps
instead of silently falling back to US.

Also guard against empty leading variants in typing_setup.py's xkb_choice.

---------

Co-authored-by: David Heinemeier Hansson <[email protected]>
@bjarneo
bjarneo deleted the share-console-keymap-xkb-table branch November 27, 2026 08:55
@emirb emirb added this to the 4.6.0 milestone Dec 1, 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.

3 participants