Skip to content

Instantly share code, notes, and snippets.

@gjazali
Last active May 26, 2024 10:07
Show Gist options
  • Save gjazali/9a2e677e87a650e40db2c049abe409a2 to your computer and use it in GitHub Desktop.
Save gjazali/9a2e677e87a650e40db2c049abe409a2 to your computer and use it in GitHub Desktop.
Getting Non-Latin Input Methods to Work

Getting Non-Latin Input Methods to Work on Arch-based Systems

To input non-Latin languages such as Mandarin Chinese and Japanese, one would need to install an Input Method Framework (IMF) and an Input Method Editors (IME). For me, the IMF that works best is Fcitx5, which is designed to be lightweight. In Arch-based systems, installing it is straightforward:

sudo pacman -S fcitx5

To use a GUI for configuring Fcitx5, install fcitx5-qt:

sudo pacman -S fcitx5-qt

For the IMEs, you can see the list containing available ones here (note the Fcitx5 column).

Make sure to add the following environment variables to .xprofile to make sure that they get defined before the WM loads:

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

Additionally, to get Fcitx5 to work with Kitty, add the following to .xprofile:

export GLFW_IM_MODULE=ibus # This works for both Ibus *and* Fcitx5

To make sure that every non-Latin characters can be displayed correctly, download fonts that support them, such as the one below, which mainly supports the full set of characters for CJK languages:

sudo pacman -S adobe-source-han-sans-otc-fonts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment