Files
omarchy/default/sddm/hyprland.lua
T
75b327bc28 Apply the system keyboard layout to the SDDM greeter (#6896)
* Apply the system keyboard layout to the SDDM greeter

* Extract shared assert_resolved_input helper

* Make the missing vconsole.conf tests actually open nothing

The stub only returned nil for an unset OMARCHY_VCONSOLE, but bash passes it
through as "", so both fallback cases were reading an empty temp file instead
of exercising the failed open.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-03 20:23:00 -04:00

63 lines
1.9 KiB
Lua

-- Minimal Hyprland config for the SDDM Wayland greeter.
-- SDDM starts the greeter itself after the compositor is ready.
-- The layout resolution below is deliberately duplicated from
-- default/hypr/input.lua. The greeter runs as the sddm user and starts from
-- this file directly, so it never goes through default/hypr/bootstrap.lua --
-- which builds package.path from $HOME and therefore can't set up require()
-- here. Keep the two in sync.
local function read_vconsole()
local values = {}
local file = io.open("/etc/vconsole.conf", "r")
if not file then
return values
end
for line in file:lines() do
local key, value = line:match("^%s*([%w_]+)%s*=%s*(.-)%s*$")
if key and value then
value = value:gsub("%s+#.*$", "")
value = value:gsub('^"(.*)"$', "%1")
value = value:gsub("^'(.*)'$", "%1")
values[key] = value
end
end
file:close()
return values
end
-- Layouts that can't type Latin letters. Keep in sync with the list in
-- etc/mkinitcpio.conf.d/omarchy_hooks.conf and default/hypr/input.lua.
local non_latin_layouts =
" af am ara bd bg by et ge gr il in iq ir kg kh kz la lk mk mm mn mv np rs ru sy th tj ua "
local vconsole = read_vconsole()
local kb_layout = vconsole.XKBLAYOUT or "us"
local kb_variant = vconsole.XKBVARIANT or ""
local kb_options = ""
-- A greeter that can't type Latin letters can't take a password either, so a
-- non-Latin layout gets us in front, reachable back with Left Alt + Right Alt.
if non_latin_layouts:find(" " .. kb_layout:match("^[^,]*") .. " ", 1, true) then
kb_layout = "us," .. kb_layout
kb_variant = "," .. kb_variant
kb_options = "grp:alts_toggle"
end
hl.config({
input = {
kb_layout = kb_layout,
kb_variant = kb_variant,
kb_options = kb_options,
},
misc = {
disable_hyprland_logo = true,
disable_splash_rendering = true,
force_default_wallpaper = 0,
},
animations = {
enabled = false,
},
})