Prepend 'us' to kb_layout when non-Latin layout is set

Choosing a non-Latin layout (e.g. ara, il, ru) via /etc/vconsole.conf
leaves Hyprland unable to match Omarchy's Latin-keysym bindings, since
Hyprland resolves bindings against the first layout in kb_layout only.
Prepending 'us' when the detected layout doesn't already include it
keeps shortcuts reachable, and activating grp:alts_toggle lets the user
switch to their layout with Left Alt + Right Alt.
This commit is contained in:
husamemad
2026-07-26 18:19:00 -07:00
committed by David Heinemeier Hansson
parent d3fdaca1a9
commit b018719338
+15 -3
View File
@@ -23,12 +23,24 @@ end
local vconsole = read_vconsole()
local layout = vconsole.XKBLAYOUT or "us"
local variant = vconsole.XKBVARIANT or ""
local kb_options = "compose:caps,shift:both_capslock"
-- Prepend 'us' so Omarchy's Latin-keysym bindings resolve — Hyprland matches
-- bindings against the first layout in kb_layout, not the currently active one.
if not (","..layout..","):find(",us,", 1, true) then
layout = "us," .. layout
variant = "," .. variant
kb_options = kb_options .. ",grp:alts_toggle"
end
hl.config({
input = {
kb_layout = vconsole.XKBLAYOUT or "us",
kb_variant = vconsole.XKBVARIANT or "",
kb_layout = layout,
kb_variant = variant,
kb_model = "",
kb_options = "compose:caps,shift:both_capslock",
kb_options = kb_options,
kb_rules = "",
follow_mouse = 1,
sensitivity = 0,