Contents Table

  1. 1.0 Introduction
  2. 2.0 Installation Step by step
  3. Reference

1.0 Introduction

I just want to install a Pinyin ime on my Omarchy.

2.0 Installation Step by Step

2.1 Install fcitx5 package

fcitx5 is the main framework. fcitx5-rime connects Rime to it. fcitx5-gtk / fcitx5-qt allow GTK and Qt applications, such as browsers and editors, to use the input method correctly. fcitx5-configtool provides a GUI for configuration.

sudo pacman -S  fcitx5 fcitx5-rime fcitx5-configtool fcitx5-gtk fcitx5-qt

2.2 Set environment

sudo vim /etc/environment

Add following content

GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
SDL_IM_MODULE=fcitx
GLFW_IM_MODULE=ibus

XMODIFIERS is especially important for XWayland applications, including many Electron apps such as VS Code and browsers. GLFW_IM_MODULE=ibus is a compatibility workaround for some GLFW programs, not a typo. After making these changes, you must log out and log back in (or restart your computer) for them to take effect.

2.3 Enable fcitx5

#edit ~/.config/hypr/hyprland.conf
#add
exec-onece = fcitx5 -d

-d runs the daemon in the background.

2.4 Set default input

fcitx5-configtool

On the Input Method tab, arrange the group in this order:

  1. Keyboard - English (US) ← Put this first (this will be the default)
  2. Rime ← Put this second

(Uncheck Only Show Current Language in the bottom-left corner to see Rime. Add it, then use the up and down arrows to change the order.)

How this works: The default fcitx5 shortcut, Ctrl + Space, switches between the first input method and the current input method. Because the English keyboard is first, English is the default input method after startup. Press Ctrl + Space once to switch to Rime and type Chinese. Press it again to return to English. This gives you exactly the setup you need.

If you want to replace Ctrl + Space with another shortcut, open Global Options in configtool and customize the shortcut for enabling or disabling the input method.


References

https://gist.github.com/wey-gu/2875e6037829fa3e78b5f2e5365b71c2