Fcitx5 + Rime on a 2015 Chromebook (postmarketOS): GTK_IM_MODULE=fcitx, not fcitx5

I just got Chinese input (wubi + pinyin via Rime) working on my ASUS C100P Flip Chromebook — postmarketOS edge, armv7, 2 GB RAM, MATE on X11. Two things made it real: a minimal package set, and one environment variable half the internet gets wrong.

Install is 10 packages:

doas apk add fcitx5 fcitx5-rime fcitx5-gtk3 fcitx5-gtk4

Resist the "install everything" reflex. On armv7, fcitx5-chinese-addons doesn't exist, fcitx5-configtool needs plasma6 (never built on armhf), and the old full chain dragged in qt6-qtwebengine, which pins icu-libs-76 — on Alpine edge that froze my nodejs at Node 22 (that icu standoff is exactly why I ripped the whole thing out months ago). Rime alone covers wubi and pinyin; my schemas/dictionaries live in my dotfiles repo and get symlinked into ~/.local/share/fcitx5/rime/, so fcitx5 deploys them on first start.

Then ~/.xprofile:

export GTK_IM_MODULE=fcitx      # NOT fcitx5
export QT_IM_MODULE=fcitx       # NOT fcitx5
export XMODIFIERS="@im=fcitx5"  # yes, this one really is fcitx5

The asymmetry is not a typo. Alpine's fcitx5-gtk registers the GTK input module under the id fcitx only — the widely-documented fcitx5 alias never connects. The symptom is maddening: tray icon alive, right-click menu works, even tray "Restart" works — but fcitx5-remote stays 0 (no input context has ever connected) no matter which window has focus, and no keystroke ever reaches the daemon.

Proof in 60 seconds, using zenity as a disposable GTK app and xdotool to tap Shift into it:

export DBUS_SESSION_BUS_ADDRESS="unix:path=$(ls /tmp/dbus-* | head -1)"
GTK_IM_MODULE=fcitx5 zenity --entry & sleep 2   # fcitx5-remote → 0, dead
GTK_IM_MODULE=fcitx  zenity --entry & sleep 2   # fcitx5-remote → 1
xdotool keydown Shift_L; sleep 0.05; xdotool keyup Shift_L   # → 2: rime active

fcitx5-remote states: 0 = no client ever connected, 1 = inactive, 2 = active. A focused GTK window that never lifts you off 0 is an env problem, not a daemon problem — stop restarting fcitx5 and fix the variable.

Two traps if you debug from an ssh/agent shell. First, fcitx5 started there inherits the shell's stale DBUS_SESSION_BUS_ADDRESS and becomes an orphan daemon on a dead bus, invisible to the GUI session — take the real bus from the session process: tr '\0' '\n' < /proc/$(pgrep -n mate-session)/environ | grep ^DBUS_. Second, environment is baked at process birth: mate-terminal windows are all spawned by a factory that inherited the session's env at login, so per-window fixes don't stick — .xprofile plus one logout/login is the only global cure (mate-terminal --disable-factory buys you a single standalone window meanwhile). After that, double-tap Shift toggles Rime and the dotfiles-managed wubi86/pinyin_simp schemas come up on first deploy.

Comments

  1. Markdown is allowed. HTML tags allowed: <strong>, <em>, <blockquote>, <code>, <pre>, <a>.