LoginSignup
6
10

More than 3 years have passed since last update.

Ubuntu (KDE)で日本語入力 [fcitx mozc]

Last updated at Posted at 2018-08-12

環境

  • Ubuntu 18.04
  • Debian 9

(内容が不十分だったので2019-05-03に更新しました。)

対処

ibusが入っていたら削除

terminal.sh
sudo apt purge ibus

fcitxとGTK,QT4,5の関連パッケージをインストール

terminal.sh
sudo apt install fcitx fcitx-mozc fcitx-frontend-gtk2 fcitx-frontend-gtk3 fcitx-frontend-qt4 fcitx-frontend-qt5 fcitx-ui-classic kde-config-fcitx mozc-utils-gui

正常にインストールできたら、

terminal.sh
# 環境変数に必要なものを追加(zshの人は.bash_profileを.zprofileに)
echo 'export XIM_PROGRAM=fcitx' >> ~/.bash_profile
echo 'export XIM=fcitx' >> ~/.bash_profile
echo 'export GTK_IM_MODULE=fcitx' >> ~/.bash_profile
echo 'export QT_IM_MODULE=fcitx' >> ~/.bash_profile
echo 'export XMODIFIERS="@im=fcitx"' >> ~/.bash_profile

source ~/.bash_profile # 環境変数読み込み
fcitx-autostart # fcitxデーモンを起動&自動起動するようにしておく(ここで先の環境変数XMODIFIERSが必要)
im-config -n fcitx # IMEの入力をfcitxに設定
fcitx-configtool # mozcを追加

※fcitx-configtoolでは「Only Show current Language」のチェックを外す
ここまで終えたらログアウト→ログイン
有効になればCtrl+Spaceで言語切り替え可能

補足

  • うまく行かない場合はログアウト→ログイン(再起動は不要)やfcitx-diagnoseで検査して処置

  • GTKアプリ系もうまく行くはず

    • うまく行かない場合は環境先の環境変数に適切な値が設定されているか確認してください。
    • 例) env|grep XIMXIM_PROGRAM=fcitxXIM=fcitxの出力
6
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
10