Fcitx5

Fcitx5 is an input method framework with a lightweight core, offering additional language support via addons. It is the successor to Fcitx.

Installation

Install the fcitx5 package.

fcitx5-im group provides fcitx5 ontology, #Configuration tool, and necessary #Input method module.

Note: fcitx5 has only a basic framework, it just gives English support. If you want to input other languages, such as Chinese or Japanese, you need an Input Method Engine (IME).

Chinese

Japanese

  • , a popular Japanese input engine. However, it is not actively developed anymore.
  • , a Japanese Kana Kanji input engine, based on libkkc.
  • fcitx5-mozc, based on Mozc, the Open Source Edition of Google Japanese Input.
  • , a Japanese Kana Kanji input engine, based on .

Other languages

  • , for typing Korean hangul, based on .
  • or , for typing Vietnamese characters.
  • or fcitx5-table-other, for typing other miscellaneous languages — use the latter for typing IPA (X-SAMPA).

Input method module

To get a better experience, you should install the following modules as per your needs. Without them, the input method may still work on most applications but you might experience input method hang up, preview window screen location error, or no preview error.

  • For Qt programs, install .
  • For GTK programs, install fcitx5-gtk.
  • For Qt4 programs, install .
  • For Qt5 programs, install .
  • For Qt6 programs, install .
  • For date and time support, install .

Usage

Integration

Set the following environment variables:

GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx

If your locale is , and your GTK2 application cannot activate fcitx5, you can set the input method to xim specifically for it, for example:

$ env GTK_IM_MODULE=xim <your_gtk2_application>

Do not set to xim globally as it affects GTK3 programs as well. XIM has various problems (such as the input method cannot input after restarting), so try not to use it.

Desktop Environment Autostart

If you want Fcitx5 to autostart when you start your desktop, execute the following command:

$ cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart/
Tip: To see if Fcitx5 is working correctly, open an application and press Ctrl+Space to switch between input methods (when configured), and input some words.

Chinese

For the Chinese input method of Fcitx5, several words libraries are currently provided in the repository:

  • fcitx5-pinyin-zhwiki: A words library created by felixonmars based on Chinese Wikipedia. Applicable to Pinyin input method.
  • : A words library for Rime input method
  • : A words library for Rime input method
  • cedict: A words library converted from cedict dictionary.
  • moegirl: A words library created by outloudvi based on Moegirlpedia

Chinese

Generally speaking, since fcitx5 supports importing the Sogou words library, there is no need to customize words library to a large extent, but fcitx5 still provides related tools.

  • Install

The original words library file is a text file, its format is:

After getting the original dictionary file, execute .

The custom dictionary file can be placed in

Configuration

Configuration tool

The configuration file of fcitx5 is located at ~/.config/fcitx5. Although you can use a text editor to edit the configuration file, you might find a GUI configuration tool much more convenient, so install the package.

Disable overriding XKB settings

By default Fcitx5 overrides X keyboard settings. (The ones you can set with command or graphical tools provided by desktop environments.) If you do not want that, run fcitx5-configtool and uncheck Addons > XCB > Allow Overriding System XKB Settings.

Themes

The number of default themes is limited, you can find more themes on GitHub.

  • : Fcitx5 theme to match the KDE Breeze style.
  • : Nord Color Themes.
  • : This theme gives a feeling like Microsoft PinYin. Its official repository is located at GitHub: Fcitx5-Material-Color. Its README.md file shows some beautiful configurations of one-line mode.
  • : Solarized color theme for Fcitx5.
  • : Fluent-Design dark theme with blur effects and shadows.
Tip: If you are using KCM, then switch themes with: Setting > Location > input method > Configure addons > Classic user interface > Theme.

Enable single-line mode

In the settings of the Pinyin input method (or Rime input method), enable Show preedit within application to enable single-line mode.

Troubleshooting

Diagnose problems

If you have problems using fcitx5, eg. if fails to work in all applications, then the first thing you should try is to diagnose using . The output of should contain clues for the most common problems.

Cannot use fcitx5 single-line mode in some applications

1. If the single-line mode does not work in gtk applications such as Firefox, please install fcitx5-gtk

2. The single-line mode does not work in WPS Office and Sublime Text, this is a problem of WPS Office and Sublime Text itself, not a problem of fcitx5.

Fcitx5 has position errors in JetBrains IDEs

The cause of this issue is that the JBR shipped with the IDE is not correct, to fix this issue you need to:

1. Download this jbr and extract it.

2. Follow this guide to change IDE's JBR.

Emoji show abnormally in the candidate box

  • Confirm you have a font with emoji support installed (such as )
  • Set the system font as Noto Sans CJK SC for Simplified Chinese, for example.
  • Restart Fcitx5 by the following command:
$ kill `ps -A | grep fcitx5 | awk '{print $1}'` && fcitx5&

Cannot use fcitx5 in RStudio

Run the following command:

$ strings /usr/lib/rstudio/lib/libQt5Core.so.5 | grep "Qt 5"

Find out the version of the Qt library, use this version to recompile in , and put it into directory.

If you are using , you can install directly.

Cannot use fcitx5 in Steam and Dota2

In fact, Fcitx5 can be used in Steam big screen mode and Dota2. But need to use to activate IME instead of Ctrl+Shift

Candidate popup misaligned in HiDPI mode of Gtk environments

If the position of your candidate popup is not anchored at your cursor position, install fcitx5-gtk.

fcitx5 unavailable for kitty

See Kitty#Enable IME support.

Tips and tricks

Customizing Traditional and Simplified Chinese conversion

Some IMEs assume Simplified Chinese by default, resulting in incorrect characters being displayed when using Traditional input, e.g. 爲什麼 instead of 為什麼. To fix this, the usage of the can be customized.

To configure conversion, set to one of the following values:

  • s2t - Simplified to Traditional (OpenCC) (this is the default and probably not what you are looking for)
  • s2tw - Simplified to Traditional (Taiwan)
  • s2twp - Simplified to Traditional (Taiwan) with Taiwanese idiom
  • s2hk - Simplified to Traditional (Hong Kong)

To configure the reverse, set to one of the following values:

  • t2s - Traditional (OpenCC) to Simplified (OpenCC) (this is the default and probably not what you are looking for)
  • tw2s - Traditional (Taiwan) to Simplified (OpenCC)
  • tw2sp - Traditional (Taiwan) to Simplified (OpenCC) with Mainland Chinese idiom
  • t2hk - Traditional (OpenCC) to Hong Kong variant
  • t2tw - Traditional (OpenCC) to Taiwan Standard
  • tw2t - Traditional (Taiwan) to Traditional (OpenCC)
  • hk2s - Traditional (Hong Kong) to Simplified (OpenCC)
  • hk2t - Traditional (Hong Kong) to Traditional Chinese (OpenCC)
  • t2jp - Traditional (Kyūjitai) to New Japanese Kanji (Shinjitai)
  • jp2t - New Japanese Kanji (Shinjitai) to Traditional (Kyūjitai)

Up to date list here: OpenCC

How to view the Unicode encoding of selected characters

  • If you want to view the Unicode encoding of the selected text in a text editor, then directly select the text, and then use the shortcut keys to view the encoding of the selected text.
  • If you want to view the Unicode encoding of some text in a non-editable area (such as this wiki), you need to first copy the text to the clipboard, then click on any editable area (such as the search box), and then use the shortcut keys to view the encoding of the text in the clipboard.

Input special characters

In general, for some simple symbols, such as , , , , etc., you can enter them through Configuring compose key, but for more special symbols, such as , , , etc., you Either customize , or use Fcitx5's Unicode function to achieve.

Take as an example:

Position the cursor in any input box, and then press , and then enter , you will see a variety of , other special characters are similar here.

Switching Halfwidth / Fullwidth Punctuation

For fcitx5-chinese-addons, fullwidth punctuation is used by default, one may use to switch between halfwidth and fullwidth punctuation.

Automatically switch input methods in vim

Additional code:

If you are using , then append the above code to

Note: If you add this code in vim.cmd, you may need to uncomment it.

Import Sogou words library

  • For KDE users, you can import Sogou words library through
  • For users who use , you need to manually open the software "Fcitx5 Configuration" and manually configure it in the Pinyin input method.

You can import local words library or browse and import online words library

Cloud Pinyin

On the settings page of the Pinyin input method, you can enable Cloud Pinyin. But if you need to change the default backend of Cloud Pinyin, you need to change it in the global settings of fcitx5. Provided backends are , Baidu,

Stroke Filter

Set the shortcut key after the "stroke filter" of the pinyin input method you set (the default is ) Then after entering the text, press the shortcut key, the words stroke filter will appear in the candidate box of the input method, and the words can be filtered by strokes. The specific rules are: h horizontal stroke, s vertical stroke, p left-falling stroke, n right-falling stroke, z turning stroke

By default, the stroke filter is to filter the first character of a sentence, but you can switch between different characters in a sentence by using determining characters by word.

For example, to perform stroke filtering on the third character in the word 中华人民共和国, you can press twice in a row after enabling stroke filtering to let fcitx5 perform stroke filtering on it.

Import words library

Take importing words library and as an example.

1. Change the ~/.local/share/fcitx5/rime/luna_pinyin.custom.yaml file (take as an example, and modify the name of the other input schemes)

2. Create a new file

~/.local/share/fcitx5/rime/extended.dict.yaml
# The following disables the default words library and does not enable the default "Baguwen" words library and word frequency system, if you do not want traditional characters and box characters to appear in candidate words
---
name: extended
version: "2021.02.19"
sort: by_weight
use_preset_vocabulary: false #Whether to enable the default "Baguwen" words library and word frequency system, if you want to enable it, please set it to true.
import_tables:
  # - luna_pinyin #Default words library, please uncomment if you want to enable it
  - zhwiki
  - moegirl
  # - custom words library name
...

Fuzzy sound settings

Please comment (#) or delete unnecessary fuzzy sounds as needed. If you need to add other fuzzy sounds, please refer to Mingyue Pinyin fuzzy sound custom template

If the file does not exist

If the file exists, paste the part below to the end of the file (there is only one in )

Special Symbols

Import the words library in the rime-dict project to input Greek letters, some mathematical symbols and Emoji expressions in Pinyin

Example:

  • Greek letters: input to output α
  • Mathematical symbols: input to output
  • Special symbols: Input to output
  • Serial number: input to output
  • Emoji expression: Input haha to output

Load librime-lua plugin

If you want to load the librime-lua plugin, you must add the module in the Rime input method settings of the fcitx configuration tool.

gollark: I find some of Nim's behaviour weird but it certainly has some cool parts. Such as templates, easy custom operators, the indentational syntax, and `result` in functions.
gollark: Nim *can* be slightly insane sometimes.
gollark: I have thoughts, yes.
gollark: It's a shame the current helloboi code is kind of slow to run, and also accursedly unmodular rapidly written bad python.
gollark: It would be cool if we could embed helloboi neural networks™ in arbitrary programs, actually.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.