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 via XDG autostart for Qt/GTK/XIM, but Wayland text-input requires KWin to launch it as the virtual keyboard. Select Fcitx 5 under “System Settings → Input Devices → Virtual Keyboard” and log in again. An fcitx5 started only by XDG autostart does not deliver text to Wayland-native apps.
Wayland-native apps use the compositor’s input method protocol, so they work
without the environment variables above. Electron apps (Chromium-based) need
--enable-wayland-ime; because KWin exposes text-input-v3, ZIGNOS’s Discord
(r2 and later) also passes --wayland-text-input-version=3 in the launcher.
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 -
The values exist in a TTY but are empty only in the Plasma session — if a PLM session does not pick up
/etc/environment, write these 3 lines to~/.config/plasma-workspace/env/im.shas a workaroundターミナルウィンドウ export GTK_IM_MODULE=fcitx5export QT_IM_MODULE=fcitx5export XMODIFIERS=@im=fcitx5Log out and back in to apply it. Compare
envin a TTY (the PAM value) with/proc/<plasmashell PID>/environ(the session value) to isolate the cause -
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 (r2 and later) starts with
--enable-wayland-ime --wayland-text-input-version=3on Wayland. Update withzpkg install -f discord. Also check that Fcitx 5 is selected under KDE’s “Virtual Keyboard” and that these report the expected values:ターミナルウィンドウ kreadconfig6 --file kwinrc --group Wayland --key VirtualKeyboardEnabledkreadconfig6 --file kwinrc --group Wayland --key InputMethod -
Japanese is not displayed — install
fonts-noto-cjk(oripaex-fonts)
Related: Desktop / KDE Plasma 6 / Wayland and Xwayland
