Japanese input (fcitx5 + Mozc)
Japanese input on ZIGNOS is the fcitx5 + Mozc combination. It works from Qt / GTK / Xwayland apps in a Plasma 6 Wayland session too.
Installing the packages
Section titled “Installing the packages”zpkg install fonts-noto-cjk fonts-noto-emojizpkg install fcitx5 fcitx5-qt fcitx5-gtk fcitx5-configtoolfcitx5— the input method itselffcitx5-qt— input context plugin for Qt 6 appsfcitx5-gtk— the GLib client and the IM module for GTK 3fcitx5-configtool— GUI for configuring input methodsfonts-noto-cjk— font for Japanese display (ipaex-fontsalso works)
Mozc requires the fcitx5 USE flag. Add it to package.use before
installing. Without the flag, the Mozc build intentionally fails.
echo 'mozc fcitx5' >> /etc/zpkg/package.usezpkg install mozcBecause Mozc builds the fcitx/mozc fork with Bazel, the first build takes time
and disk space. When it finishes, the fcitx5 addon (fcitx5-mozc.so),
mozc_server and mozc_tool are installed.
Environment variables
Section titled “Environment variables”To make sure the input method module is loaded, add the following 3 lines to
/etc/environment. /etc/environment is not a shell script, so do not add
export or quotes.
cat >> /etc/environment <<'EOF'GTK_IM_MODULE=fcitx5QT_IM_MODULE=fcitx5XMODIFIERS=@im=fcitx5EOF| Variable | Target |
|---|---|
GTK_IM_MODULE=fcitx5 |
GTK 3 apps |
QT_IM_MODULE=fcitx5 |
Qt 6 apps |
XMODIFIERS=@im=fcitx5 |
X11 / Xwayland apps |
PAM’s pam_env reads these values at login. Log out → log in (or a reboot)
is required for them to take effect.
On older installations: if
pam_envis not in the PAM stack,/etc/environmentis not read. linux-pam r4 and later support it, so update first withzpkg install -f linux-pamon earlier systems.
To try it only in the current session, set them directly in the terminal and restart fcitx5.
export GTK_IM_MODULE=fcitx5export QT_IM_MODULE=fcitx5export XMODIFIERS=@im=fcitx5fcitx5 -d --replaceConfiguring the input method
Section titled “Configuring the input method”- After setting the environment variables, log in again
- Start
fcitx5-configtool - Add Mozc on the “Input Method” tab
- By default,
Ctrl+Spacetoggles Japanese input on/off
fcitx5 starts together with Plasma via XDG autostart. If it is not running, add
fcitx5 -d under System Settings → Autostart.
Wayland-native apps use the compositor’s input method protocol, so they work
without the environment variables above. Electron apps (Chromium-based),
however, must specify --enable-wayland-ime. ZIGNOS’s Discord (r1 and later)
passes this flag in the launcher. Selecting Fcitx5 under “System Settings →
Input Devices → Virtual Keyboard” in KDE Plasma enables the Wayland input
method protocol.
Checking it works
Section titled “Checking it works”echo "GTK=$GTK_IM_MODULE QT=$QT_IM_MODULE X=$XMODIFIERS"pgrep -a fcitx5fcitx5-diagnoseType Japanese in Konsole or Kate, and if Ctrl+Space switches to Mozc you are
done. The same check works in GTK 3 apps (e.g. gtk3-demo).
Troubleshooting
Section titled “Troubleshooting”- Mozc does not appear in the input method list — check that
mozcwas built with thefcitx5USE flag. If/usr/lib/fcitx5/fcitx5-mozc.sois missing, reinstall - The environment variables are empty — check that you logged in again after
editing
/etc/environment. PAM reads it only at login - Only GTK apps cannot convert — reinstall
fcitx5-gtkand check that/usr/lib/gtk-3.0/3.0.0/immodules/im-fcitx5.soexists - Only Xwayland apps cannot convert —
XMODIFIERSis not in effect. Check the 3 lines in/etc/environmentand log in again - Input does not work in Discord — Discord (r1 and later) starts with
--enable-wayland-imeon Wayland. For older packages, update withzpkg install -f discord. Also check that Fcitx5 is selected under KDE’s “Virtual Keyboard” - Japanese is not displayed — install
fonts-noto-cjk(oripaex-fonts)
Related: Desktop / KDE Plasma 6 / Wayland and Xwayland
