Skip to content

Move us to the front of a non-Latin layout list instead of duplicating it - #14076

Merged
emirb merged 2 commits into
omacom:quattrofrom
manuaudio:fix/keyboard-layout-no-duplicate-us
Oct 22, 2026
Merged

emirb merged 2 commits into
omacom:quattrofrom
manuaudio:fix/keyboard-layout-no-duplicate-us

Conversation

@manuaudio

@manuaudio manuaudio commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #14074 (also filed as #14075).

When the first console layout cannot type Latin letters, the session config puts us first so Omarchy's Latin-keysym bindings resolve. It did that by prepending us, to the complete list, even when us was already present. XKBLAYOUT=ru,us became us,ru,us, so grp:alts_toggle appeared to do nothing on every other press. Variants could also become detached from their layouts.

I keep us first, as e232c99 intended, but move an existing us entry and its positional variant instead of adding a duplicate. Layouts without us retain the old prepend behavior. After #6896 copied this resolution into the SDDM config, I rebased and applied the same fix there so the session and greeter stay in sync.

The focused regression covers both resolvers with:

  • the existing il,us case, which fails on quattro because it produces [us,il,us]
  • the reported ru,us list
  • ru,us with phonetic,intl, proving that intl follows us
  • ua,us,de with positional variants, proving that the third pair remains intact

All 16 checks in test/shell.d/hyprland-keyboard-layout-test.sh pass. keyboard-layout-test.sh and input-group-migration-test.sh also pass. Greptile reviewed commit 59a36f2d at 5/5 with no actionable finding.

I did not run a live SDDM login cycle; the greeter path is covered by the focused resolver test.

Fixes #14075

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issue or outstanding previous finding was identified.

Summary

The PR moves an existing Latin-capable us layout and its positional variant to the front of a non-Latin layout list in both the session and greeter configurations. It adds regression cases for layout order, variant alignment, and non-Latin us variants.

Reviews (3) · Last reviewed commit: "Keep a plain us in front when the list's..." · Reviewed by Greptile

@aholbreich

Copy link
Copy Markdown
Contributor

#6896 merged after this was opened and copies this layout logic into default/sddm/hyprland.lua (its comment says to keep the two in sync), including the same prepend at lines 40-44. Evaluated at 75b327bc: XKBLAYOUT=ru,us gives the greeter us,ru,us, and with phonetic,intl the variants become ,phonetic,intl. So the greeter has the bug this PR fixes. #6896 also rewrote hyprland-keyboard-layout-test.sh, and this branch now conflicts there. Rebasing and applying the same change to the SDDM file would cover both.

@manuaudio
manuaudio force-pushed the fix/keyboard-layout-no-duplicate-us branch from d6b7e81 to 59a36f2 Compare October 4, 2026 02:27
@manuaudio

Copy link
Copy Markdown
Contributor Author

@aholbreich Thanks, good catch. I rebased onto current quattro, resolved the rewritten test, and applied the same move-with-variant behavior to default/sddm/hyprland.lua. The focused test now exercises both the session and greeter for ru,us with variants and a three-layout case. All 16 layout checks plus the two related focused test files pass at 59a36f2d.

@aholbreich

Copy link
Copy Markdown
Contributor

Thanks. Checked 59a36f2d merged onto current quattro (035ce29f, clean merge): hyprland-keyboard-layout-test.sh passes 16/16, and the greeter cases now match the session ones. Looks right to me.

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

everything seems fine, ready to merge.

@aholbreich

Copy link
Copy Markdown
Contributor

Rechecked after this week's rewrite of default/hypr/input.lua (#14433 reads the layout through keyboard.selected(), #14939 changed the compose option). This still merges cleanly onto current quattro (84cfb93), and hyprland-keyboard-layout-test.sh passes 25/25 on the merge, including #14433's new picker cases. On quattro alone, your first new case still fails with us,il,us.

@manuaudio

Copy link
Copy Markdown
Contributor Author

Thanks for rechecking this against both rewrites. The clean merge and 25/25 result confirm the branch still fits current quattro, so I’m leaving the head unchanged.

@omarchybot omarchybot added the bug Something isn't working label Oct 15, 2026
us(rus) is Russian phonetic and us(chr) is Cherokee. Moving one of those to the front, as XKBLAYOUT=ru,us with XKBVARIANT=,rus would, leaves no Latin layout leading, so the session's keybindings and the greeter's password both stop working. Only reuse a us entry whose variant types Latin; otherwise prepend plain us as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge and removed verified Omarchy Triage has verified that this issue is ready for final review labels Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on an Omarchy worker VM. The bug is real and this fixes it. I pushed one small fix to the branch, described below.

What was checked

  • test/shell.d/hyprland-keyboard-layout-test.sh fails on quattro (b7e900ce) with [us,il,us]. It passes 28/28 with this branch merged onto quattro (a clean merge) and 18/18 at the branch head.
  • ./test/cli, keyboard-layout-test.sh (64/64) and input-group-migration-test.sh pass on the merge.
  • Live on the worker, with XKBLAYOUT=ru,us and XKBVARIANT=phonetic,intl, Hyprland loads kb_layout=us,ru and kb_variant=intl,phonetic. switchxkblayout alternates between Russian (phonetic) and English (US, intl.), so the toggle has one stop per layout.

Pushed: e667d247 Keep a plain us in front when the list's us can't type Latin

Codex (medium effort), the second reviewer, found a case the move gets wrong: two us variants don't type Latin letters, us(rus) (Russian phonetic) and us(chr) (Cherokee). With XKBLAYOUT=ru,us and XKBVARIANT=,rus, the branch moved us(rus) to the front and produced us,ru / rus,, so no Latin layout led. That breaks the session's Latin keybindings and the greeter password. quattro keeps a plain us there. The commit only reuses a us entry whose variant types Latin; otherwise it prepends plain us as before. It touches both default/hypr/input.lua and default/sddm/hyprland.lua, with a test for each. Those are the only two non-Latin variants in /usr/share/X11/xkb/symbols/us. The new tests fail at 59a36f2d and pass at e667d247.

Codex reviewed the fix in a second round and found nothing further. Its independence from this review is not guaranteed.

I also linked #14075, the same report as #14074, so both close when this merges. The open #12896 edits the same if line in default/hypr/input.lua for a different bug (Serbian Latin), so whichever lands second will need a small merge.

Nothing is left for the author. This is waiting on the maintainer.

@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 15, 2026
@manuaudio

Copy link
Copy Markdown
Contributor Author

Thanks for catching the non-Latin us variants. e667d247 keeps the original plain-us fallback for us(rus) and us(chr) while retaining the move for Latin-capable variants. The new session and greeter cases, with failure at 59a36f2d and passes at e667d247, cover the boundary I missed. I have nothing further to change.

@emirb
emirb merged commit a17a001 into omacom:quattro Oct 22, 2026
2 checks passed
@emirb

emirb commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Thanks @manuaudio!

@manuaudio

Copy link
Copy Markdown
Contributor Author

Thanks @emirb. I confirmed the merge at a17a001; ru,us now keeps one US stop while the session and greeter preserve positional variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

5 participants