Setup Input Method for WSL

date: Oct 28, 2019


This article will talk about how to configure input method for CJK input. Using Ubuntu as example.


WSL do not support direct CJK input from Windows input method, so we need to configure input method independently on WSL. This will applies to both multi-window mode and single-window mode on your preferred X Server.

Install fcitx

Type the follwing command:

sudo apt install fcitx fonts-noto-cjk fonts-noto-color-emoji dbus-x11

This will install CJK fonts and fcitx.

Then, install the input method you want. Here is a list of common fcitx input method:

Language Input Method Package
Chinese sunpinyin-based pinyin input fcitx-sunpinyin
Chinese libpinyin-based pinyin input fcitx-libpinyin
Chinese Google Pyinyin Input fcitx-googlepinyin
Chinese rime-based Chinese input fcitx-rime
Chinese Chewing Input fcitx-chewing
Japanese Anthy-based Japanese Input fcitx-anthy
Japanese mozc-based Japanese Input fcitx-mozc
Japanese Kana-Kanji Converter (kkc) Japanese Input fcitx-kkc fcitx-kkc-dev
Korean Korean Input fcitx-hangul
Vietnamese unikey-based Vietnamese Input fcitx-unikey
Sinhalese Sinhalese Input fcitx-sayura
- Fcitx Tables Input fcitx-table fcitx-table-all

Install using sudo apt install <Package>.

Confiure environment

generate dbus machine id using root account:

dbus-uuidgen > /var/lib/dbus/machine-id

create /etc/profile.d/ file using root account with following content:

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

fcitx-autostart &>/dev/null

Initial Configuration

Make sure you X Server is already started and complete configured DISPLAY. For WSL2, make sure public access is granted on your X Server.

Run following commands:

export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export DefaultIMModule=fcitx
fcitx-autostart &>/dev/null

fcitx will start now.

Run fcitx-config-gtk3, following interface will appear:

If you complete input installation but don’t see your input method,press + on the bottom left corner and search for the input you installed:

Press OK to add.

Then choose Global Config and change the hotkey to **Trigger Input Method and Scroll between Input Method (They are conflict with Microsoft Pinyin Input Hotkey):

Now, the configuration is complete!


In any GUI application, use the hotkey set for Trigger Input to start input method and use the hotkey set for Scroll between Input Method to switch input method, the outcome is like the following:


Not the Footnote

The site is proudly powered by Hexo and using a site strcuture from the Hexo theme called Nayo.

The site is powered by the glorious CSS from bettermotherf** with some tweaks. Censored the f-word for good.

This site is hosted on Digital Ocean. Deploy your next app in seconds. Get $100 in cloud credits from @DigitalOcean using my link.

Custom Stickers, Die Cut Stickers, Bumper Stickers - Sticker Mule

Possibly the Footnote

Main | Access | RSS | Sitemap
2008 - 2020 | Patrick WU Jinming