Operations 15 min read

Rime on Ubuntu: 6-Step Setup, Wayland Fixes & 8 Pitfalls

This guide walks through installing and configuring the Rime input engine on Ubuntu, comparing IBus and Fcitx5 frameworks, detailing Wayland-specific environment variables, explaining the patch-based configuration system, adding the Rime-Ice dictionary, and listing eight common pitfalls including Snap/Flatpak integration issues.

Ubuntu
Ubuntu
Ubuntu
Rime on Ubuntu: 6-Step Setup, Wayland Fixes & 8 Pitfalls

Understanding Rime: Engine vs Frontend

Rime (中州韵) is not an input method itself but an input method engine. It converts keystroke sequences (e.g., nihao) into candidate words (你好). The frontend handles UI, candidate window placement, and text commitment. On Linux, the frontend is either IBus or Fcitx5. The article emphasizes that many "Rime configuration not working" issues stem from the frontend not running, not from configuration errors.

Rime is fully offline: no cloud sync, no user profiling, no ads. Input habits are stored as plain text files locally, making it popular among developers and privacy-conscious users.

Choosing a Framework: IBus vs Fcitx5

Ubuntu defaults to IBus (GNOME official), which works out of the box with low configuration difficulty. Fcitx5 (community-driven) requires manual installation but offers higher customizability: themes, plugins, cloud pinyin, Lua extensions, and better Wayland support, especially for Flatpak apps.

Recommendation: Choose IBus if you only want immediate Chinese input; choose Fcitx5 for long-term use and willingness to configure once.

Critical rule: Never run both frameworks simultaneously. They compete for input focus, causing intermittent input, disappearing candidate windows, and apps that cannot input Chinese. Verify the active framework with:

echo $XDG_SESSION_TYPE   # wayland or x11
im-config                # current default framework

Installation Paths

Path A: IBus (Quickest)

sudo apt update
sudo apt install ibus-rime

Then in Settings → Keyboard → Input Sources, add Chinese (China) → Rime. Log out/in or run ibus restart. Switch with Super+Space.

Path B: Fcitx5 (Recommended for Long-term)

sudo apt install fcitx5 fcitx5-rime fcitx5-configtool
sudo apt install fonts-noto-cjk  # prevent tofu characters

Set as default: im-config -n fcitx5 Log out/in. Run fcitx5-configtool, click +, uncheck "Only Show Current Language", search for Rime or 中州韵, add to left panel, apply. If Chinese options are missing, install language pack: sudo apt install language-pack-zh-hans.

Wayland Configuration

Ubuntu 22.04+ uses Wayland by default. Many tutorials set three environment variables, but Fcitx's official Wiki clarifies: modern GTK3/4 apps use the text-input-v3 protocol and do not need GTK_IM_MODULE; however XMODIFIERS is still required for X11/XWayland apps, and Qt apps (outside KDE) need QT_IM_MODULE=fcitx.

More reliable method: write to systemd user environment directory:

mkdir -p ~/.config/environment.d
cat > ~/.config/environment.d/im.conf << 'EOF'
XMODIFIERS=@im=fcitx
QT_IM_MODULE=fcitx
EOF

Log out/in. Verify with echo $XMODIFIERS.

Wayland tray icon may be missing. Enable GNOME extension:

gnome-extensions enable [email protected]

Log out/in to restore the tray icon (needed for "Redeploy" action).

Configuration Directory & Patch Mechanism

Configuration directories differ by frontend:

IBus: ~/.config/ibus/rime Fcitx5: ~/.local/share/fcitx5/rime (XDG_DATA_HOME; older tutorials incorrectly use ~/.config/fcitx5/rime)

Verify by typing a few characters, then run find ~ -name "*.userdb" 2>/dev/null; the user dictionary location indicates the config directory.

Never edit default.yaml directly. Rime overwrites it on every redeploy. Instead, create default.custom.yaml using patch: syntax to override only desired keys. Example:

# default.custom.yaml
patch:
  "menu/page_size": 9
  schema_list:
    - schema: luna_pinyin_simp
    - schema: double_pinyin_flypy

Changes require "Redeploy" (not reboot or re-login). Three ways:

fcitx5-remote -r   # Fcitx5
ibus restart        # IBus
# or right-click tray icon → Deploy

First deploy compiles dictionaries and may take tens of seconds.

Installing Rime-Ice (雾凇拼音) for Better Dictionary

Rime's built-in "Mingyue Pinyin" is conservative, lacking internet slang and IT terms. The community-maintained Rime-Ice provides a modern Chinese dictionary covering hot words, IT terminology, and emojis, approaching Sogou's experience.

# Fcitx5
rm -rf ~/.local/share/fcitx5/rime
git clone --depth 1 https://github.com/iDvel/rime-ice.git ~/.local/share/fcitx5/rime

# IBus
rm -rf ~/.config/ibus/rime
git clone --depth 1 https://github.com/iDvel/rime-ice.git ~/.config/ibus/rime

Then redeploy. To update later: git pull in the directory and redeploy. Warning: Cloning wipes existing config. Backup *.userdb files first if you have a personal dictionary.

Six Essential Post-Install Tweaks

Candidate count: Default 5 is too few. In default.custom.yaml: patch: "menu/page_size": 9 Chinese/English toggle: Default Shift is "temporary English" (hold to type English, release to return). Windows-style toggle can be set in frontend config.

Page keys: Default - / =; many prefer , / .. Change via patch.

Fuzzy pinyin: Essential for southern speakers. Add speller/algebra rules in scheme patch, e.g., derive/^([zcs])h/$1/, derive/^([zcs])([^h])/$1h$2/, derive/([aei])n$/$1ng/ for zh/z, n/l, ing/in.

Multiple schemas: Rime supports many schemes simultaneously. Add double_pinyin_flypy (Xiaohe Shuangpin) and wubi86 (Wubi 86) to schema_list; switch with F4. Mixed Pinyin+Wubi input is possible.

Backup & sync: Configs are plain text, ideal for Git. Initialize a repo in the config directory. Official sync via installation.yaml: set sync_dir to sync user dictionary across machines via cloud storage.

Eight Common Pitfalls (Save Two Hours)

Intermittent input: IBus and Fcitx5 both running. Use im-config to keep only one.

Missing tray icon on Wayland: Enable [email protected] extension.

Config changes not applied: Forgot to redeploy. Rebooting does not help.

Config lost after upgrade: Edited default.yaml instead of .custom.yaml.

Snap apps (e.g., Chromium) cannot input Chinese: Permission isolation. Fix: sudo snap connect chromium:fcitx5.

Flatpak apps cannot input Chinese: Missing runtime. Install: flatpak install flathub org.fcitx.Fcitx5.

VS Code candidate window not following cursor: Add "enable-browser-ime": true to ~/.vscode/argv.json.

System crashes after installing Sogou: Sogou Linux is based on Fcitx4, incompatible with Fcitx5. Do not install on new Ubuntu.

Pitfalls 5, 6, 7 are variants of the same root cause: sandboxed applications (Snap, Flatpak, Electron) cannot access the host's input method channel. When a single app fails, check if it is Snap/Flatpak/Electron.

Conclusion

Rime's reputation is polarized: critics call configuration hostile; advocates never switch back. The learning curve is front-loaded: understanding engine/frontend separation, locating config directory, mastering patch mechanism, and resolving Wayland issues — about 1-2 hours one-time cost.

After that, you gain a fully offline input method with per-keystroke rule control, Git-versionable config and dictionaries, and consistent experience across Windows (Weasel), macOS (Squirrel), and Linux. For anyone typing thousands of characters daily, the investment pays off.

If you only need immediate input, use Path A ( ibus-rime) in five minutes. If you plan to stay on Ubuntu long-term, spend an hour setting up Fcitx5 + Rime-Ice and forget about it for years.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

configurationUbuntuinput methodWaylandFcitx5IBusRimeRime-Ice
Ubuntu
Written by

Ubuntu

Focused on Ubuntu/Linux tech sharing, offering the latest news, practical tools, beginner tutorials, and problem solutions. Connecting open-source enthusiasts to build a Linux learning community. Join our QQ group or channel for discussion!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.