omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Weird behaviour with multiple keyboard layouts

Open ablluu opened this issue 9 months ago • 4 comments

System details

Intel(R) Core(TM) Ultra 5 125U, Omarchy 3.3.3

What's wrong?

My Laptop has a German ISO layout and i bought a keyboard that is US ANSI. So i need to run two kb layouts in the input config:

kb_layout = de, us
kb_variant = nodeadkeys,altgr-intl
kb_options = grp:ctrls_toggle, compose:caps

Thisd worked but at random intervals (no obvious pattern, like media keys, per window, per workspace) it just switched back. I mad myself a waybar config to see the active layout

  "hyprland/language": {
    "format": "{}",
    "format-en": "US",
    "format-de": "DE",
    "on-click": "hyprctl switchxkblayout at-translated-set-2-keyboard next",
    "tooltip-format": "{long}"
  }

This showed that only while typing was the language set to US, immidietaly when moving the mouse out of the window it switched back to the default

Then i found that fcitx5 was running that seems to be a tool that manages keyboard layouts and it had to be conflicting with the wy hyprland normally does things. Since i have not really installed any programs in that direction and it appears in various config files i will assume it is some part of omarchy?

There is a workaround, just kill the process, one can write this into the autostart.

Please advise on whether not running this could cause other issues?

ablluu avatar Feb 11 '26 20:02 ablluu

I can reproduce this on a fresh Omarchy 4.0.2-1 installation, with an additional installer/Fcitx handoff failure that gives a clean explanation for the layout reverting to US.

System

  • Omarchy 4.0.2-1
  • 2011 15-inch MacBook Pro, Apple Internal Keyboard / Trackpad
  • Intel Core i7-2635QM
  • Intel HD 3000 + AMD Radeon HD 6490M-class graphics

Reproduction

  1. During installation, select CH De as the keyboard layout.
  2. Boot into the graphical session.
  3. Focus an application using the Fcitx Wayland input path and type.
  4. The layout is US / behaves inconsistently with the selected Swiss layout. On this Mac keyboard, expected Option-layer characters such as brackets and @ are also unavailable with the generic Swiss mapping.

State after installation

The installer did save the console/XKB layout correctly:

# /etc/vconsole.conf
KEYMAP=sg
XKBLAYOUT=ch

The user ~/.config/hypr/input.lua contained no active override. Omarchy's packaged Hyprland default therefore correctly derives kb_layout = "ch" from XKBLAYOUT.

However, Fcitx independently initialized this profile:

# ~/.config/fcitx5/profile
Default Layout=us
DefaultIM=keyboard-us

[Groups/0/Items/0]
Name=keyboard-us

omarchy-fcitx5.service was enabled and active. This gives the graphical session two conflicting layout authorities: Hyprland uses the installer-selected ch, while Fcitx injects keyboard-us.

Verified workaround

For the built-in Swiss Mac keyboard, I added this user override:

hl.config({
  input = {
    kb_layout = "ch",
    kb_variant = "de_mac",
  },
})

I also changed the stopped Fcitx profile to:

Default Layout=ch-de_mac
DefaultIM=keyboard-ch-de_mac

[Groups/0/Items/0]
Name=keyboard-ch-de_mac

The service must be stopped before editing the profile: restarting it after an edit causes the old running instance to autosave keyboard-us during shutdown and overwrite the change.

After starting Fcitx again:

fcitx5-remote -n
keyboard-ch-de_mac

Apple Internal Keyboard: German (Switzerland, Macintosh)
Fcitx virtual keyboard:  German (Switzerland, Macintosh)

This restores the expected symbols from the installed XKB ch(de_mac) mapping: Right Option+5/6 produces [/], and Right Option+G produces @.

Expected behavior

The layout and variant selected during installation should be propagated to both Hyprland and Fcitx. Fcitx should not silently initialize keyboard-us when /etc/vconsole.conf already declares a non-US XKBLAYOUT.

For Mac hardware, the installer should also preserve/select the appropriate *_mac variant. The current XKB Macintosh variant itself uses only Right Option as Level3 (include "level3(ralt_switch)"), which is surprising to macOS users who expect either Option key to access symbols; if Omarchy intentionally accepts that upstream behavior, the UI should at least explain it.

cmyk avatar Aug 31 '26 15:08 cmyk

OS: Omarchy 4.0.2-1 Keyboard: Apple Magic Keyboard with Numeric keypad

I have two keyboard layouts. In Omarchy 4 I had issues with switching the layout: the shortcut that changes it didn't work, so I had to manually click on the waybar

After updating to 4.0.2-1, the language stopped working at all: changing the layout in the waybar has no effect.

In the terminal, If I run hyprctl switchxkblayout main next, I can type in Russian, but if I move the focus to another window and back, the layout is reset to back to English.

hl.config({
  input = {
    kb_layout = "us,ru",
    kb_variant = ",phonetic_YAZHERTY",
    kb_options = "compose:caps,shift:both_capslock_cancel,altwin:swap_alt_win,grp:alt_shift_toggle"
  }
})

oburlaca avatar Sep 01 '26 09:09 oburlaca

I found the issue, only one setting is responsible for the problem:

altwin:swap_alt_win

If I replace it in input.lua with the original grp:alts_toggle, everything works. Now the questions is, how to use 'altwin:swap_alt_win' but keep the keyboard layout working.

oburlaca avatar Sep 05 '26 07:09 oburlaca

Related data point for the two-authorities class (different mechanism from the above reports, linking not duplicating):

On Omarchy 4.0.4 / Hyprland 0.56.2 / fcitx5 5.1.22 with us,il layouts, the default kb_options (compose:caps,shift:both_capslock_cancel from default/hypr/input.lua:37) broke a user-written Alt+Shift fcitx5 enumerate hotkey: shift:both_capslock_cancel turns the Shift_L release into Caps_Lock, and fcitx5 (key_trace=5) never matched the chord when Shift was released first (Key(Alt+Shift+Caps_Lock ... Release:1) → noop; Alt-first releases switched every time). Removing the XKB option fixed both release orders (cost: no Both-Shifts Caps Lock while Caps is Compose).

Suggestion for the manual: note that shift:both_capslock_cancel breaks Shift-based fcitx5 hotkeys depending on release order, so users writing their own fcitx5 switch keys don't lose a day to it. Full write-up with trace excerpts was filed upstream as fcitx/fcitx5#1697.

Plutarch01 avatar Sep 30 '26 06:09 Plutarch01