Fcitx and KDE

A Story In 87 Browser Tabs

keywords: kde, linux, fcitx, pinyin input, im-config, fcitx-googlepinyin, qtconfig, qt, kubuntu

I recently moved laptops, which means I have a fresh Linux install that needs configuring. (Remember to back up first!) As with a real-life move (which I am also in the middle of, in addition to the shutdown), it’s a chance to start new. To leave behind old, bad habits and obsessions, to grow and flourish in new directions in a vast digital territory.

Or so I tell myself.

I grew up using Ubuntu from Ubuntu 8 “Hardy Heron” through 18 “Bionic Beaver”, and only a few years ago switched over to Kubuntu. By no means a radical shift in the Linux community. And I’ve never attempted to run Arch, because I’m not really a purist with a burning need to display my “e-peen” to the world. If you want to see the awesome desktops of competitive geekery, check out r/unixporn.

Visuals are nice, but secondary, as I do need a few things to remain the same across installs, functionality-wise. One of those is Chdinese-Zh Pinyin input, and (secondarily) unicode.

So that I can type things like: 學而時習之不亦樂乎 and 𒊦 or 𒊧. (If you see boxes there, set the page Character encoding to UTF-8.) Frustratingly, KDE does not have easy integration with either ibus or fcitx out-of-the-box like Gnome does. The actual process to get pinyin input in KDE is not that difficult, but figuring out that process took me almost four hours all together.

I’m not sure I am confident enough to call this a “guide,” but I want to have a record of the things I tried that eventually worked, even if just for my future self.

Libraries Installed

I can’t guarantee these alone will satisfy all system requirements across distros. I installed nearly everything with ‘fcitx-*’ from the repos. And it depends on which versions of GTK and Qt apps your system has running.

Installing fcitx, fcitx-config, and fcitx-googlepinyin will also grab a lot of the other dependencies, it may not be necessary to install each file listed below manually. If you are in need of backports for a GTK2 app or Qt3, the Kubuntu/backports PPA is a good place to pull from.

fcitx fcitx-config fcitx-googlepinyin fcitx-config-gtk2
fcitx-frontend-qt4 fcitx-frontend-qt5 fcitx-modules
language-pack-zh-hans qtcongif-qt4


The solution to Fcitx not triggering when in Kate or other apps was to run qtconfig-qt4 from the terminal, and in the drop-down menu under “Input Method” select Fcitx instead of ibus or Xim.

I also added the following lines to ~/.profile, which may be ~/.xprofile on some distros.

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

As with other IM changes, log out and log back in and voilá! Fcitx should now trigger when the hotkeys are pressed anywhere there is a cursor.

Maybe this solution works for some, but I did not have either of those files, and adding them did not seem to make a difference, nor did their deletion now that Fcitx is working.

I also installed and tried using ibus for a bit, just to see if it enjoyed OOTB-usability as many of the forum suggestions claimed. Spoiler: it did not. I had the same issues running ibus as I had with Fcitx, where it would trigger in browsers, but not in any other text-application.


With a bit of time, hopefully someone else’s, it is quite possible to input Chinese characters in KDE desktop apps. With the vast number of CJK-users out there, I am somewhat surprised that the process is as complicated as it is, and that CJK support has not been built in to the KDE project as of yet. This likely reflects the geographic distribution of KDE developers, however, not because “it isn’t important.”

I would like to try and make the process more streamlined, trying various methods on a fresh install of Kubuntu to see which is the most efficient. If I do, I will update this post (or just link to the new study). If I can make an efficient enough script, maybe it could get included in an actual distro release. Then I could add: “Linux developer” to my LinkedIn, right above “Accomplished Technical Writer & Life Guru.”