(Very Brief) Guide to Japanese Input on Arch Linux

For anyone studying language with a character set other than English, being able to swap back and forth between input languages is important. This kind of functionality may come setup out of the box on Mac or Windows, but we need to do a little bit of work to get this functionality in Linux.

IMF vs IME

The TL;DR here is a classic client/server architecture, think of X11 vs a window manager.

In this case, the IMF or Input Method Framework (IMF) is the component that provides the actual software interface for managing input methods. It handles the current input context, handles key events for swapping inputs, and communicates with actual applications.

It also manages what are called ‘candidate’ windows, which is the small pop up window for choosing between potential character options when you’re typing. This is relevant when using an input like Japanese or Chinese, where the same phonetics/English letters can translate to many meanings/Kanji characters.

On the other hand, the IME or Input Method Engine is responsible for the translation of your actual keyboards input language, and the phonetics of that language, into the output language. It will include a dictionary for the language, conversion algorithms for suggesting output candidates, and can manage frequently selected candidates.

Installation

For Japanese I use a combination of fcitx and Mozc.

I have the following packages installed, but on Arch you should only need to explicitly install fcitx5, fcitx5-mozc, and fcitx5-configtool:

local/fcitx5 5.1.14-1 (fcitx5-im)
    Next generation of fcitx
local/fcitx5-configtool 5.1.9-1 (fcitx5-im)
    Configuration Tool for Fcitx5
local/fcitx5-mozc 2.31.5810.102.gb091429-1
    Fcitx5 Module of A Japanese Input Method for Chromium OS, Windows, Mac
    and Linux (the Open Source Edition of Google Japanese Input)
local/fcitx5-qt 5.1.10-1 (fcitx5-im)
    Fcitx5 Qt Library (Qt5 & Qt6 integrations)

In Wayland environments you want to start fcitx via fcitx5, for example in my sway config I have:

# execs
exec_always mako
exec_always --no-startup-id fcitx5

Once fcitx is running we need to configure the bind for Next input method and add Japanese as our second input method. If your Desktop Enviroment or bar has a tray section, you may have an icon there for fcitx, otherwise you can run Fcitx 5 Configuration from mako/rofi/etc. In Fcitx 5 Configuration I’ve set ctrl+space as my keybind and added Mozc as an input method.

keybind input

Usage

Now we can use our input method keybind to swap between languages. Once we’ve swapped to Japanese input we can type using English letters (Romaji), fcitx will automatically insert Hiragana for us and it will open a candidate window to suggest and allow us to select proper Kanji for whatever we have types.

typing