OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
audio-input medium common DISPUTE

Get CJK input working in Electron and XWayland apps under Hyprland

omarchyarchendeavouroscachyosmanjarohyprlandwaylanddesktoplaptop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

The diagnosis is accurate and most of it is wiki-sourced: fcitx5-im is confirmed a real package GROUP (fcitx5, fcitx5-configtool, fcitx5-gtk, fcitx5-qt, exactly the four the record names), fcitx5-chinese-addons and fcitx5-mozc exist in extra, and chromium --wayland-text-input-version=3 is verbatim from Arch Fcitx5 line 41 along with the v1-vs-v3 mismatch explanation. The defect is a fabricated API call: hl.exec_once() does not exist in Hyprland's Lua config. I grepped the entire wiki content tree. There is no hl.exec_once anywhere. Autostart.md documents autostart exclusively as hl.on("hyprland.start", ...) with hl.exec_cmd(). Pasting hl.exec_once will throw a Lua error that kills execution of the rest of that config file, so it breaks more than just the IME.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.

Symptom

Ctrl+Space does nothing and Chinese/Japanese/Korean input is impossible, or it works in some apps but not others, typically dead in Electron/Chromium and XWayland apps while working in native Wayland ones. The candidate popup may also fail to appear at all.

Cause

On Wayland, native clients use the text-input protocol and need no environment variables, but XWayland and toolkit-specific clients still need the legacy IM-module env vars. Version mismatches (Chromium defaults to text-input-v1 while most compositors implement v3) break it further, and fcitx5 must actually be autostarted.

Fix


sudo pacman -S --needed fcitx5-im fcitx5-chinese-addons fcitx5-mozc

Set the env vars for XWayland/toolkit clients. On Omarchy the session is started by uwsm, and the Hyprland wiki explicitly says uwsm users should NOT put env vars in hyprland.lua. Use ~/.config/uwsm/env with export KEY=VAL:


# ~/.config/uwsm/env
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export SDL_IM_MODULE=fcitx

Only if you are NOT using uwsm, the Hyprland equivalent is hl.env("GTK_IM_MODULE", "fcitx") etc. Note that setting GTK_IM_MODULE/QT_IM_MODULE globally also diverts native Wayland apps off the text-input protocol. The Arch wiki recommends scoping them to XWayland apps where you can.

Autostart the daemon. hl.exec_once() does NOT exist and will throw a Lua error that kills the rest of that config file. Use the documented form:


-- ~/.config/hypr/hyprland.lua
hl.on("hyprland.start", function()
  hl.exec_cmd("fcitx5 -d")
end)

On Hyprland 0.54 and older the hyprlang equivalents are env = GTK_IM_MODULE,fcitx and exec-once = fcitx5 -d.

Log out and back in, then configure input methods with fcitx5-configtool, and run fcitx5-diagnose when something still does not work. For Chromium/Electron apps on the wrong protocol version, launch with chromium --wayland-text-input-version=3.

Verify

fcitx5-diagnose reports no errors for your frontends, and Ctrl+Space switches input methods with a working candidate popup in both a native Wayland terminal and an XWayland app.

Sources

fcitx5-cjk-input-not-working-wayland