Setting up a Chinese input method on Debian
This guide teaches 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 guides you through downloading the fcitx
package using the apt
package manager. The
fcitx
package allows 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 teaches you how to 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)
Click Configure (see Figure 2 below)
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 teaches you how to 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)
Click Only Show Current Language to uncheck the Only Show Current Language box (see Figure 4 below)
Click the search bar (see Figure 5 in the next step below)
Search for Sunpinyin (see Figure 5 below)
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)
Ensure that Sunpinyin has been added to your list of input methods (see Figure 7 below)
Click Global Config at the top of the window (see Figure 8 below)
Configuring fcitx
This section teaches you how to configure fcitx, making fcitx 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
Enabling fcitx at startup
Gnome and Xfce desktop environments 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 guides you through a series of tests to ensure fcitx is working 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