How to make Fcitx Anthy work

Step 1: Install the required packages

Basically you need :

  • kcm-fcitx if you are on KDE + fcitx-qt5 (especially if you want to use qt apps in Gnome)
  • fcitx-gtk* variants for the non QT apps
  • fcitx-anthy input method for the Japanese keyboard (or another variant for Chinese or Korean)

To be able to write Japanese kanjis make sure the following packages are also installed as well:

  • anthy (the package containing the binary)
  • locales-ja (recommended)
  • locales-extra-charsets (you need more than the basics)
  • dbus-daemon (to -auto- restart fcitx)

Step 2: Activate the input

To be able to use the input method in different situations, you just need to do the setup by yourself following the official guideline here

Basically adding the following line at the end of your .bash_profile is enough.
Note:
.bash_profile, not .bashrc or a custom file in /etc/environment/

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

Step 3: Autostart

Still following the same guideline, copy the reference .desktop file to your use folder :

cp /usr/share/applications/fcitx.desktop ~/.config/autostart/fcitx.desktop

Example :

[Desktop Entry]
Name=Fcitx
Name[ca]=Fcitx
Name[da]=Fcitx
Name[de]=Fcitx
Name[es]=Fcitx
Name[ja]=Fcitx
Name[ko]=Fcitx
Name[ru]=Fcitx
Name[zh_CN]=Fcitx
Name[zh_TW]=Fcitx
GenericName=Input Method
GenericName[ca]=Mètode d'entrada
GenericName[da]=Inputmetode
GenericName[de]=Eingabemethode
GenericName[es]=Método de entrada
GenericName[ja]=入力メソッド
GenericName[ko]=입력기
GenericName[ru]=Метод ввода
GenericName[zh_CN]=输入法
GenericName[zh_TW]=輸入法
Comment=Start Input Method
Comment[ca]=Inicia el mètode d'entrada
Comment[da]=Start inputmetode
Comment[de]=Eingabemethode starten
Comment[ja]=入力メソッドを開始
Comment[ko]=입력기 시작
Comment[ru]=Запустить метод ввода
Comment[zh_CN]=启动输入法
Comment[zh_TW]=啓動輸入法
Exec=fcitx-autostart
Icon=fcitx
Terminal=false
Type=Application
Categories=System;Utility;
StartupNotify=false
X-GNOME-AutoRestart=false
X-GNOME-Autostart-Notify=false
X-KDE-autostart-after=panel
X-KDE-StartupNotify=false

Restart your computer and it should work.

TroubleShootings

If fcitx appears in the system tray but disappears after a few seconds, or doesn’t show up,
in ~/.config/autostart/fcitx.desktop as you probably figure it out by yourself, try to use fcitx-autostart instead of fctix for the [exec] param.
The script will add a 2sec delay and check as well for exising instances before launching.

If you can’t activate the input in some gtk apps for example, you might need to tune a bit some environment variables as described here.

You may have to manually activate the input module in gtk with the following commands:

sudo gtk-query-immodules-2.0 --update-cache
sudo gtk-query-immodules-3.0-64 --update-cache

Note:
your bash_profile should be enough, no need to mess with /etc/


Credits: @peter-power-594 - link

1 Like