How to type Chinese (Cangjie / Quick) on Pop!_OS 24.04 with the COSMIC desktop

📁 Computer

Original Article was published on Medium: https://medium.com/hong-kong-linux-user-group/how-to-type-chinese-cangjie-quick-on-pop-os-24-04-with-the-cosmic-desktop-178627ac335f?sharedUserId=wanleung

Many people who upgraded to Pop!_OS 24.04 found that Chinese input simply stopped working. The reason: Pop!_OS moved to the new COSMIC desktop, which is Wayland-only and speaks only the newer input-method protocol (zwp_input_method_v2). The IBus and Fcitx5 versions shipped with Pop!_OS 24.04 are too old for it, so Cangjie, Quick and every other Chinese input method are dead on arrival.

Back in 2018 I wrote “How to use Cangjie / Quick on Ubuntu with an English interface”, using HKLUG’s ibus-cangjie. This time IBus itself is out of the picture, and waiting for upstream could take a long while — so I wrote a new input method instead: cosmic-ext-ime.

cosmic-ext-ime talks to COSMIC’s Wayland compositor directly. No IBus, no Fcitx:

- Cangjie and Quick (倉頡/速成) via libcangjie2, with the same key behaviour as ibus-cangjie
- Any RIME schema via librime — Jyutping, Pinyin, Bopomofo and more
- A candidate window that follows the COSMIC theme and display scaling
- Chinese/English switching with COSMIC’s own SUPER-SPACE
- Works in COSMIC apps and GTK apps (Firefox, GNOME apps)

Here are the steps to install and set it up.

1. Install

Open a TERMINAL and run:

> sudo add-apt-repository ppa:wanleungwong/cosmic-ext-ime
>
> sudo apt install cosmic-ext-ime

sudo add-apt-repository ppa:wanleungwong/cosmic-ext-ime

sudo apt install cosmic-ext-ime

If you previously used ibus-cangjie or Fcitx, clean up the old configuration first, otherwise GTK apps will keep trying to talk to IBus:

> im-config -n none

Also check ~/.profile and ~/.bashrc for these lines and remove them if present:

> export GTK_IM_MODULE=ibus
>
> export QT_IM_MODULE=ibus
>
> export XMODIFIERS=@im=ibus

Then LOGOUT and LOGIN again. The input method starts automatically with the COSMIC session — nothing to launch by hand.

2. Add a Chinese input source

cosmic-ext-ime does not invent its own toggle key. It follows COSMIC’s input sources: when the Chinese keyboard layout is active you type Chinese, when you switch back to English you type English.

Open SETTINGS → Keyboard → Input Sources, press +, search for “Chinese” and add it.

An input-source indicator (en / cn) appears on the panel.

3. Type Chinese

Press SUPER-SPACE to switch to Chinese and start typing. While entering a Cangjie code, the candidate window shows the radicals and the matching characters; press a number to pick one, or SPACE to take the first candidate or go to the next page.

With Quick, type just the first and last code and the candidates appear immediately.

4. Settings

Search for “Input Method” in the APP LIBRARY and open Input Method Settings. Every change applies immediately; no restart needed.

You can configure:

- Mode: Cangjie or Quick
- Cangjie version: 3 (as used on Windows) or 5
- Candidates per page
- Full-width or half-width punctuation and digits
- Character sets: Big5, HKSCS (Hong Kong characters), plus optionally all Chinese characters, Japanese kanji, hiragana, katakana and more

5. For RIME users

If RIME is your thing, set Engine to RIME in the settings and pick any installed RIME schema — for example Jyutping:

> sudo apt install librime-data-jyutping

Then choose the schema in the settings. RIME customisation files (*.custom.yaml) live in ~/.local/share/cosmic-ext-ime/rime; press Redeploy after editing them.

Known limitations

The Qt 5 and Qt 6.4 packages in Pop!_OS 24.04 do not implement Wayland’s text-input-v3, so Qt apps do not work yet; Flatpak versions of Qt apps are fine. X11 apps are not supported either.

Closing

cosmic-ext-ime is open source (GPL-3); the code is at https://github.com/wanleung/cosmic-ext-ime. If you run into problems or have suggestions, please open an issue on GitHub.

That’s it.