From b018719338d7130ef0e0e625f15d8bab76ac6a5d Mon Sep 17 00:00:00 2001 From: husamemad Date: Wed, 22 Jul 2026 22:04:59 +0300 Subject: [PATCH] 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. --- default/hypr/input.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/default/hypr/input.lua b/default/hypr/input.lua index 27f3184d..6fddb9e0 100644 --- a/default/hypr/input.lua +++ b/default/hypr/input.lua @@ -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,