Setting up a Chinese input method on Debian

2019-11-05 00:00

This guide will teach you how to setup a Chinese input method on Debian. It is intended for users who have basic graphical navigation and command-line skills in a Unix-like environment or a Debian-based Linux distribution.

This document consists of the following sections:

Conventions used in this guide

Requirements

Downloading the fcitx input method using apt

This section will guide you through downloading the fcitx package using the apt package manager. The fcitx package will allow you to type in Pinyin to produce Chinese characters.

To download the fcitx package using apt

  1. Run the following command:

     sudo apt install fcitx fcitx-sunpinyin
  2. Confirm the installation by typing y when prompted

Accessing fcitx’s configuration settings

This section will help you access fcitx’s configuration settings, so you can then make using fcitx more convenient.

To access fcitx’s configuration settings

  1. Run fcitx on the command line to access fcitx’s configuration settings

  2. Right-click the icon in your system tray

    A screenshot of the fcitx icon in the system tray
  3. Click Configure

    A screenshot of the fcitx menu popping up after right-clicking the icon in the system tray

Finding the fcitx Sunpinyin input method

This section will help you find the Sunpinyin input method, so you can then add it to your list of active input methods.

To find the fcitx Sunpinyin input method

  1. Click the + symbol on the bottom-left of fcitx window

    A screenshot of the “+” symbol highlighted inside of the fcitx configuration window
  2. Click Only Show Current Language to uncheck the Only Show Current Language box

    A screenshot of a list of language input methods, and the option “Only Show Current Language” is unchecked inside of the fcitx configuration window
  3. Click the search bar

  4. Search for sunpinyin

    A screenshot of a user searching for sunpinyin inside of the fcitx configuration window
  5. Click Sunpinyin to select it

  6. Click the OK button in the bottom-right of the window

    A screenshot of sunpinyin selected and the “OK” button held down inside of the fcitx configuration window
  7. Ensure that Sunpinyin has been added to your list of input methods

    A screenshot of the English US and Sunpinyin input methods listed in the fcitx configuration window
  8. Click Global Config at the top of the window

    A screenshot of the “Global Config” tab highlighted in the fcitx configuration window

Configuring fcitx

This section will help you configure fcitx, so fcitx will be easier to access and use.

To configure fcitx

  1. Click the Show Advanced Options tab in the bottom-left corner of the fcitx configuration window

  2. Uncheck Use extra trigger key only after using it to inactivate

  3. Click the drop-down menu to the right of Extra key for trigger input method

  4. Choose Disabled

  5. Check Enable Hotkey to scroll Between Input Method

  6. Check Include Inactive when scrolling between Input Method

  7. Close the fcitx windows

  8. Ensure your settings match the settings shown in the image below

    A screenshot of the “Global Config” settings in the fcitx configuration window

Enabling fcitx at startup

Gnome and Xfce desktop environments will automatically add fcitx to their startup applications.

Openbox requires you to put fcitx & in your ~/.config/openbox/autostart file. The fcitx part tells Openbox to start fcitx on startup, and the & part tells your computer to run fcitx as a background process.

If you are not using Gnome, Xfce, or Openbox, continue to the section below.

To enable fcitx at startup

  1. Add the following contents to your ~/.xinitrc file:

    fcitx

  2. Logout then log back in

Making sure fcitx is working correctly

This section will guide you through a series of tests to ensure fcitx is workign correctly.

To make sure fcitx is working correctly

  1. Open up something you can type text into
  2. Hold down Ctrl
  3. While continuing to hold down ctrl, press spacebar
  4. Release spacebar
  5. Release Ctrl

You should now see the keyboard icon you saw earlier, if you have a taskbar, panel, or system tray .

A screenshot of the Sunpinyin icon in a user’s system tray