Jun Aruga's Blog

Output, activities, memo and etc.

Sway, i3: Set up Japanese input with fcitx5.

In the past, I did set up Japanese input by fcitx. As a reference, here are the blog pages.

However I noticed there is fcitx5 that is successor version of fcitx. It looks the UI is better.

According to the ArchWiki fcitx5, fcitx5-mozc is "based on Mozc, the Open Source Edition of Google Japanese Input". It looks good.

$ sudo dnf install fcitx5 fcitx5-configtool fcitx5-kkc fcitx5-mozc

I did set the needed environment variables in the following file. I had set it in the .bash_profile file. But it seems on Wayland based Sway, the .bash_profile is not loaded.

$ cat ~/.bashrc.d/40-fcitx.sh
# Set for Japanese input on fcitx5 and fcitx.
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx

Then run the daemon like this in .config/sway/config.

# Run Japanese input daemon.
# https://wiki.archlinux.org/title/Fcitx5
# The Alacritty has an issue for Japanese input with fcitx5.
# https://github.com/alacritty/alacritty/issues/1613
# The Terminator is ok.
exec --no-startup-id /usr/bin/fcitx5 -d

Then I added the kkc and mozc from the config UI on the tray.