Skip to content

Give the SDDM greeter the system keyboard layout - #9762

Closed
Yves848 wants to merge 1 commit into
omacom:quattrofrom
Yves848:fix/sddm-greeter-keyboard-layout
Closed

Yves848 wants to merge 1 commit into
omacom:quattrofrom
Yves848:fix/sddm-greeter-keyboard-layout

Conversation

@Yves848

@Yves848 Yves848 commented Sep 2, 2026

Copy link
Copy Markdown

Fixes #6880. Also covers #9421, which reports the same bug independently.

The bug

The SDDM Wayland greeter runs its own Hyprland instance:

# etc/sddm.conf.d/10-wayland.conf
CompositorCommand=start-hyprland -- --config /usr/share/sddm/hyprland.lua

default/sddm/hyprland.lua set only misc and animations — no input block — so Hyprland fell back to its built-in us default. A password set under any other layout cannot be typed at the login prompt, while the LUKS prompt (vconsole KEYMAP) and the user session (default/hypr/input.lua, which reads XKBLAYOUT) both get it right.

It is easy to miss because autologin skips the greeter at boot: the first time most users meet it is after an explicit logout, and then they simply cannot log back in.

The fix

default/hypr/input.lua already resolved the layout from /etc/vconsole.conf. That block moves to default/hypr/keyboard.lua, which returns { layout, variant, options }, and both configs read it — so the session and the greeter cannot drift apart. No behaviour change for the session; the test below pins that.

The greeter is started by sddm-helper rather than the user session, so it never runs default/hypr/bootstrap.lua. It sets up just the module path it needs, with the same os.getenv("OMARCHY_PATH") or "/usr/share/omarchy" idiom config/hypr/hyprland.lua already uses (deliberately not bootstrap.lua, which dereferences $HOME — not something to rely on in the greeter's environment).

The non-Latin fallback carries over to the greeter, and matters more there than in the session: passwords are Latin, so a non-Latin-only layout would leave the correct password untypeable. Same reasoning as the vconsole.conf guard in etc/mkinitcpio.conf.d/omarchy_hooks.conf.

kb_model and numlock_by_default are deliberately left alone — out of scope for this bug.

Verification

test/shell.d/hyprland-keyboard-layout-test.sh gains four greeter assertions alongside the existing session ones, driven through the same stubbed vconsole.conf. The greeter is loaded the way SDDM loads it — by path, with no module path prepared for it — so the package.path line is exercised rather than assumed. The non-Latin-list sync check now reads default/hypr/keyboard.lua.

ok - greeter falls back to us without vconsole.conf
ok - greeter follows the system layout
ok - greeter keeps the variant
ok - greeter keeps a latin layout reachable for passwords

./test/all: 222 of 226 shell test files pass. The 4 failures (config, snapper, unowned-system-paths, bar-icon-geometry) fail identically on an unmodified checkout here — the first three want an omarchy-pkgs checkout, the last is sub-pixel monitor geometry.

Beyond the stubs, the greeter config was run as a real nested Hyprland instance (headless backend) on a be system:

$ hyprctl -i <nested> getoption input:kb_layout
str: be
$ hyprctl -i <nested> devices -j | jq '.keyboards[].active_keymap'
"Belgian"
$ hyprctl -i <nested> configerrors
(empty)

with misc.disable_hyprland_logo and animations.enabled still resolving to the values the file already set.

Note for maintainers

The two open reports carry workarounds that no longer hold: #9421 edits the packaged /usr/share/sddm/hyprland.lua, which omarchy update silently reverts, and #6880 predates the move to Lua (it uses source = against the old hyprland.conf) and hardcodes one layout. Worth closing both on this rather than leaving those recipes as the answer.

Reported on Omarchy 4.0.2-1, Hyprland 0.56.2-1, sddm 0.21.0-7, layout be.

The greeter runs its own Hyprland instance, and its config carried no
input block, so Hyprland fell back to its built-in "us" default. A
password set under any other layout could not be typed at the login
prompt, while the TTY and the user session both had the layout right.

Move the vconsole.conf layout resolution out of default/hypr/input.lua
into default/hypr/keyboard.lua and have both configs read it, so the two
instances cannot drift apart. The greeter keeps the non-Latin fallback
for its own reason: passwords are Latin, so a non-Latin-only layout would
leave the correct one untypeable.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@IridescentRose

IridescentRose commented Sep 12, 2026 •

Copy link
Copy Markdown

Also closes related ticket: #9859

@bjarneo

bjarneo commented Sep 21, 2026

Copy link
Copy Markdown
Member

Automated duplication check: this pull request looks similar to #6896, which covers the same SDDM keyboard layout. I keep that one open and close this one to consolidate review.

If you feel this is the wrong decision, please open the PR again with a note on the difference.

@bjarneo bjarneo closed this Sep 21, 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.

SDDM greeter always uses US keyboard layout, ignoring the system layout

3 participants