Setting up a Chinese input method on Debian
2019-11-05
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
- Accessing fcitx’s configuration settings
- Finding the fcitx Sunpinyin input method
- Configuring fcitx
- Enabling fcitx at startup
- Making sure fcitx is working correctly
Conventions used in this guide
- Note: Signifies additional information
- Tip: Signifies an alternative procedure for completing a step
- Warning: Signifies that damage, such as data loss, may occur
- Example: Shows how a procedure would be performed in a real scenario
Inline code and code blocks
: Signify package names, filenames, file contents, or commands- Figure caption Signifies a description for a figure (an image)
<variable>
Signifies that the text between the<
and>
should be replaced, and the<
and>
should be removed- Bold font Signifies user interface items
Requirements
- A Debian-based Linux distribution
- A package manager (in this guide, I use the
apt
package manager)
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
Run the following command:
sudo apt install fcitx fcitx-sunpinyin
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
Run
fcitx
on the command line to access fcitx’s configuration settingsRight-click the icon in your system tray (see Figure 1 below)
Figure 1: A screenshot of the fcitx icon in the system tray Click Configure (see Figure 2 below)
Figure 2: A screenshot of the fcitx menu popping up after right-clicking the icon in the system tray Tip: If your current input method does not show up in the fcitx configuration window, try to run
pkill fcitx
on the command line to kill the fcitx process, and then runfcitx
to start the fcitx process again. If this still doesn’t work, try restarting your computer to ensure thefcitx
andfcitx-sunpinyin
packages have installed correctly
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
Click the + symbol on the bottom-left of fcitx window (see Figure 3 below)
Figure 3: A screenshot of the “+” symbol highlighted inside of the fcitx configuration window Click Only Show Current Language to uncheck the Only Show Current Language box (see Figure 4 below)
Figure 4: A screenshot of a list of language input methods, and the option “Only Show Current Language” is unchecked inside of the fcitx configuration window - Click the search bar (see Figure 5 in the next step below)
Search for sunpinyin (see Figure 5 below)
Figure 5: A screenshot of a user searching for sunpinyin inside of the fcitx configuration window - Click Sunpinyin to select it (see Figure 6 in the next step below)
Click the OK button in the bottom-right of the window (see Figure 6 below)
Figure 6: A screenshot of sunpinyin selected and the “OK” button held down inside of the fcitx configuration window Ensure that Sunpinyin has been added to your list of input methods (see Figure 7 below)
Figure 7: A screenshot of the English US and Sunpinyin input methods listed in the fcitx configuration window Click Global Config at the top of the window (see Figure 8 below)
Figure 8: 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
- Click the Show Advanced Options tab in the bottom-left corner of the fcitx configuration window
- Uncheck Use extra trigger key only after using it to inactivate
- Click the drop-down menu to the right of Extra key for trigger input method
- Choose Disabled
- Check Enable Hotkey to scroll Between Input Method
- Check Include Inactive when scrolling between Input Method
- Close the fcitx windows
Ensure your settings match the settings shown in Figure 9 below
Figure 9: 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
Add the following contents to your
~/.xinitrc
file:fcitx
Logout then log back in
Tip: If you don’t have an ~/.xinitrc
file, then you can create one by running touch ~/.xinitrc
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
- Open up something you can type text into
- Hold down Ctrl
- While continuing to hold down ctrl, press spacebar
- Release spacebar
- Release Ctrl
You should now see the keyboard icon you saw earlier, if you have a taskbar, panel, or system tray (see Figure 10 below).

Tip: If you do not see the keyboard icon mentioned above, check out the fcitx documentation