Skip to content

Persist the chosen keyboard layout's XKB pair so Hyprland picks it up - #196

Merged
scottjones merged 2 commits into
omacom:quattrofrom
kx0101:keyboard-xkb-layout
Aug 23, 2026
Merged

scottjones merged 2 commits into
omacom:quattrofrom
kx0101:keyboard-xkb-layout

Conversation

@kx0101

@kx0101 kx0101 commented Aug 23, 2026 •

Copy link
Copy Markdown

While digging into #176, I noticed the setup form only writes KEYMAP to /etc/vconsole.conf

that works for the console/LUKS prompt, but Hyprland uses XKB layout/variant settings instead, so the desktop falls back to US. Hyprland documents kb_layout and kb_variant here: [Hyprland input docs]

this adds the XKB layout/variant to the existing layout table and persists them alongside the console keymap

also added tests/test-keyboard-layouts.sh with 9 checks for the layout table and parsing

this doesn't fix the Apple \ -> £ issue from #176, that's a separate hid_apple/kernel issue. This just makes sure the layout selected during setup is actually used by the desktop

keep in mind i myself use an M4 so i can't test it myself, all i have are those tests

The setup form only ever wrote the console keymap (KEYMAP in
vconsole.conf). default/hypr/input.lua reads XKBLAYOUT/XKBVARIANT from
the same file, so a machine set up with anything but English (US)
typed US inside the desktop while the console obeyed the chosen
layout — reported in omacom#176.

Each row of the layout table now carries its XKB layout and variant
alongside the console keymap (the two naming schemes disagree: uk vs
gb, et vs ee, cf vs ca, …), and omarchy-provision-owner persists them
via localectl set-x11-keymap plus an explicit vconsole.conf write, so
the choice lands no matter what systemd-localed does on that release.
The X11 update disables console conversion so it cannot overwrite the
selected console/LUKS keymap.

Co-authored-by: Copilot <[email protected]>
@scottjones

Copy link
Copy Markdown
Collaborator

Thanks @kx0101 — this is a real gap and the right fix for it. The picker set the console keymap and nothing carried the XKB pair, so choosing German got you a German console and a US desktop. default/hypr/input.lua reads XKBLAYOUT straight out of /etc/vconsole.conf, so that's exactly the place to persist it.

I validated all 48 rows against the live XKB and kbd databases on an M2 Pro: every console keymap, layout and variant exists, including the ones that are easy to get wrong — uk→gb, et→ee, sr-latin→rs/latin, la-latin1→latam, fr_CH→ch/fr. Good table.

One thing to flag rather than block on: tests/test-keyboard-layouts.sh is flaky — 6 of 10 runs failed here, on a different layout each time. The prompt pipes the layout list into gum, and the stub exits without reading stdin, so cut dies of SIGPIPE and pipefail makes the prompt return before setting any of the variables the assertions read. Adding cat >/dev/null to the stub takes it to 12/12. (This repo has hit the same trap before — see the omacom#6608 comment in brcmfmac-supplicant-test.sh.)

I couldn't push that to your branch — your fork is of basecamp/omarchy rather than this repo, so maintainer edits don't reach it — so I'll land the one-liner right after this merges. Merging now; thanks again.

1 similar comment
@scottjones

Copy link
Copy Markdown
Collaborator

Thanks @kx0101 — this is a real gap and the right fix for it. The picker set the console keymap and nothing carried the XKB pair, so choosing German got you a German console and a US desktop. default/hypr/input.lua reads XKBLAYOUT straight out of /etc/vconsole.conf, so that's exactly the place to persist it.

I validated all 48 rows against the live XKB and kbd databases on an M2 Pro: every console keymap, layout and variant exists, including the ones that are easy to get wrong — uk→gb, et→ee, sr-latin→rs/latin, la-latin1→latam, fr_CH→ch/fr. Good table.

One thing to flag rather than block on: tests/test-keyboard-layouts.sh is flaky — 6 of 10 runs failed here, on a different layout each time. The prompt pipes the layout list into gum, and the stub exits without reading stdin, so cut dies of SIGPIPE and pipefail makes the prompt return before setting any of the variables the assertions read. Adding cat >/dev/null to the stub takes it to 12/12. (This repo has hit the same trap before — see the omacom#6608 comment in brcmfmac-supplicant-test.sh.)

I couldn't push that to your branch — your fork is of basecamp/omarchy rather than this repo, so maintainer edits don't reach it — so I'll land the one-liner right after this merges. Merging now; thanks again.

@scottjones scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mappings verified against the live XKB and kbd databases on Apple Silicon; the test flake is noted in the comment and the one-line fix follows in its own PR.

@scottjones
scottjones merged commit 1b19665 into omacom:quattro Aug 23, 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