Install and Use Chinese Input in Ubuntu


  1. Install and Configure Rime for iBus
  2. Install and Configure Pinyin for iBus
  3. Install and Configure Google Pinyin for iBus
  4. Install and Configure Rime for Fcitx
  5. Install and Configure Google Pinyin for Fcitx
  6. Remove Google Pinyin for Fcitx and Restore Rime for iBus
  7. Switch Between iBus and Fcitx
  8. Issues

Install and Configure Rime[1][2] for iBus

$sudo apt-get update
$sudo apt-get install ibus-rime

After installation, add Rime to iBus:

  1. Reboot or logout then login again.
  2. “Settings” → “Region & Language” → Add an input source by searching “rime” and select “Others” → “Chinese(Rime)” or “Chinese(Taiwan)” → “Chinese(Rime)”.

More Rime settings[3], use the accelerator: [Ctrl] + [`]

  1. Punctuation: “中/半/。”→”.,→。,”
  2. Input Method: “朙月拼音.臺灣正體” (space to input)、”朙月拼音” (space to input)、”朙月拼音.語句流” (space to select and need extra enter to input)

To accelerate keyboard layout switching in iBus:

$sudo gsettings set org.freedesktop.ibus.general switcher-delay-time -1

It is a known issue since GNOME 3.28 to 3.34 (Ubuntu 18.04, 18.10, 19.10)[4][5][6].

To customize displayed candidates, look for “page_size: 5” in “~/.config/ibus/rime/build/default.yaml”. Only 1 to 9 is allowed. MUST have a space between the colon and the number.

If the “~/.config/ibus/rime/build/luna_pinyin.schema.yaml ” exists, the “page_size” setting would overwrite the defaul in luna pinyin(朙月拼音). Edit the “luna_pinyin.schema.yaml” instead.

On 2020/6/23, iBus has no problems with OneNote but the input and candidates are both invisible in GoogleDoc.

Install and Configure Pinyin[7] for iBus

  1. Search for “ibus pinyin” in “Ubuntu Software”.
  2. Install the one from the developer: “ubuntu-bionic-updates-main”.
  3. Reboot or logout then login again.
  4. “Settings” → “Region & Language” → Add an input source by searching “pinyin” and select “Others” → “Chinese(Intelligent Pinyin)”.

More Pinyin settings, select and click on the gear icon:

Pinyin for iBus Preferences
Customize Chinese, candidates, dictionaries, user data, and etc. in Pinyin for iBus.
  • If both Rime and Pinyin are installed, use [Super] + [Space] and hold for a half-second will display a list of all available input sources. Or it would switch between the selected Chinese input method and English immediately.
  • Once installed, it cannot be removed by “Ubuntu Software”. It could be removed from the “Input Sources” list in “Settings”.
  • It is based on libpinyin which uses a more advanced algorithm (2-gram vs libgooglepinyin’s unigram) and supports more features[8] than Google Pinyin.

Install and Configure Google Pinyin for iBus[9]

The latest update is 2013/10/18 as checked on 2020/4/23. “ibus-googlepinyin” is not found using the apt-get command.

It is suggested to use the variation.[10] Both are based on libgooglepinyin.

Install and Configure Rime for Fcitx[11]

$sudo apt-get update
$sudo apt-get install fcitx fcitx-rime

After installation, change the input method:[13]

  1. Run the command: $im-config. If it is not available, run “$sudo apt-get install im-config” to install.
  2. Select “fcitx” as the “user configuration”.
  3. Reboot.
  4. “Settings” → “Region & Language” → “Manage Installed Languages”.
  5. “Fcitx” should be selected in the “Keyboard input method system”.
  6. Click on Fcitx’s icon on top, “Configure” → “+” in the “Input Method” tab → Disable “Only Show Current Language” → Add an input method by searching “rime” and select “Rime”.
  7. Make sure the accelerator in the “Trigger Input Method” in the “Global Config” tab is assigned. It must be different from the “Switch to next input source” in the GNOME Control Center (“Settings” → “Devices” → “Keyboard”) which is used by IBus.

To customize displayed candidates, look for “page_size: 5” in “~/.config/fcitx/rime/build/default.yaml”. Only 1 to 9 is allowed. MUST have a space between the colon and the number.

If the “~/.config/fcitx/rime/build/luna_pinyin.schema.yaml ” exists, the “page_size” setting would overwrite the defaul in luna pinyin(朙月拼音). Edit the “luna_pinyin.schema.yaml” instead.

Restart Fcitx to apply.

To change the background color of the candidate area, open the “Input Method Configuration” dialog in step 6. In the “Appearance” tab, enable the “Show Advanced Options” and manually set the  “Skin Name” to ‘dark’. Selecting “skin/dark/fcitx_skin.conf” in the “Skin” list doesn’t work.

On 2020/6/23, Fcitx has no problems with GoogleDoc but sometimes a double entry in OneNote or crash.

Install and Configure Google Pinyin for Fcitx

The latest update is 2020/3/23 as checked on 2020/4/23. To use it, I also need to switch from iBus to Fcitx[12] input method framework.

$sudo apt-get update
$sudo apt-get install fcitx fcitx-googlepinyin

After installation, change the input method:[13]

  1. Run the command: $im-config. If it is not available, run “$sudo apt-get install im-config” to install.
  2. Select “fcitx” as the “user configuration”.
  3. Reboot.
  4. “Settings” → “Region & Language” → “Manage Installed Languages”.
  5. “Fcitx” should be selected in the “Keyboard input method system”.
  6. Click on Fcitx’s icon on top, “Configure” → “+” in the “Input Method” tab → Disable “Only Show Current Language” → Add an input method by searching “google” and select “Google Pinyin”.
  7. Make sure the accelerator in the “Trigger Input Method” in the “Global Config” tab is assigned. It must be different from the “Switch to next input source” in the GNOME Control Center (“Settings” → “Devices” → “Keyboard”).
Acclerators are Unique
iBus and Fcitx need to use different accelerators to prevent conflicts.

To switch between the default Simplified Chinese and Traditional Chinese, use [Ctrl] + [Shift] +[F]. It can be configured in the “Simplified Chinese to Traditional Chinese” in the “Addon” tab in Fcitx:[14]

Simplified Chinese to Traditional Chinese
Customize accelerator to switch between Simplified Chinese to Traditional Chinese.

Remove Google Pinyin for Fcitx and Restore Rime for iBus

$sudo apt-get remove fcitx fcitx-googlepinyin
$sudo apt-get autoremove
$sudo apt-get install ibus ibus-rime

After installation, restore Rime for iBus:

  1. Reboot or logout then login again.
  2. “Settings” → “Region & Language” → “Manage Installed Languages”.
  3. “iBus” should be selected in the “Keyboard input method system”.
  4. Reboot. Logout then login again won’t be able to use Rime to input Chinese.

If the GNOME Control Center is lost, reinstall by:[15]

$sudo apt-get update
$sudo apt-get install gnome-control-center
  • If Ubuntu use Unity instead of GNOME, install “unity-control-center” instead.[16]
  • While removing “im-config”, “gnome-control-center” is removed, too.

Switch Between iBus and Fcitx

To switch among different input method framework, use im-config.

  1. Run the command: $im-config. If it is not available, run “$sudo apt-get install im-config” to install.
  2. Select “fcitx” or “iBus” as the “user configuration”.
  3. Reboot.

Issues

Cannot Switch Back to Chinese from English Mode in Rime

While using Rime with Fcitx, I notice it was in English mode with unknown accelerator. I cannot use [Shift] to switch back to Chinese mode.

The only solution is to hit the [F4] for [方案選單]. Use [2. 西/半/漢/。]→[2. 西文→中文] to switch to Chinese mode.

Reference

  1. RIME | 中州韻輸入法引擎:下載及安裝
  2. GitHub: RIME: RimeWithIBus
  3. GitHub: RIME: CustomizationGuide
  4. GNOME: Delay on keyboard layout switching
  5. AskUbuntu: iBus on busy system
  6. LaunchPad: Delay before you can type after switching input source
  7. GitHube: libpinyin: ibus-libpinyin
  8. Google Code: libgooglepinyin
  9. Ubuntu: ibus-googlepinyin package
  10. AskUbuntu: How can I find ibus-googlepinyin?
  11. Ubuntu: fcitx-googlepinyin package
  12. Fcitx
  13. ubuntu安装Google输入法
  14. Ubuntu 修改 谷歌输入法 简繁体切换的快捷键
  15. AskUbuntu: Restore Missing “Settings” (gnome-control-center) Icon in Ubuntu 18.04
  16. AskUbuntu: Missing System Settings after removing some packages

One thought on “Install and Use Chinese Input in Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.