1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntu 24.04 + GNOME で日本語入力環境を構築する(fcitx5 + Mozc / US キーボード)

1
Posted at

はじめに

Ubuntu 24.04 LTS(GNOME)で日本語入力を設定する方法をまとめます。
US キーボードを使用している環境を想定しています。

なぜ fcitx5 を選ぶのか

Ubuntu では主に iBusfcitx5 の2つの入力メソッドフレームワークが使えます。

fcitx5 iBus
速度 軽量・高速 やや重い
安定性 安定 GNOME との相性は良いが、たまに問題あり
設定の柔軟性 細かく設定可能 シンプル
アプリ互換性 広い(Electron アプリ等も◎) 一部アプリで入力できない問題あり

特に VS Code や Slack など Electron 系アプリで入力の問題が少ないため、fcitx5 を選択しました。

環境

  • Ubuntu 24.04.3 LTS
  • GNOME(X11)
  • US キーボード

セットアップ手順

1. fcitx5 と Mozc のインストール

sudo apt update
sudo apt install fcitx5 fcitx5-mozc fcitx5-config-qt

2. 入力メソッドを fcitx5 に設定

im-config -n fcitx5

3. 環境変数を設定

~/.profile に以下を追加します。

cat >> ~/.profile << 'EOF'

# fcitx5
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export INPUT_METHOD=fcitx
EOF

4. GNOME の IM 設定を上書き

GNOME は独自の入力メソッド管理を持っているため、fcitx5 と競合しないように設定します。

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/IMModule':<'fcitx'>}"

5. 自動起動を設定

mkdir -p ~/.config/autostart
cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart/

6. 再起動

sudo reboot

7. Mozc を入力メソッドに追加

再起動後、以下のいずれかの方法で Mozc を追加します。

方法 A: GUI で設定

  1. fcitx5-configtool を実行
  2. 「入力メソッド」タブを開く
  3. 「追加」ボタンをクリック
  4. 検索欄に mozc と入力
  5. 「Mozc」を選択して追加

8. 動作確認

テキストエディタやターミナルを開いて Ctrl+Space を押すと、日本語入力に切り替わります。

トラブルシューティング

問題の診断

fcitx5-diagnose

このコマンドで設定状況を確認できます。

よくある問題

Mozc が追加されていない

fcitx5-diagnose の出力で以下のようになっている場合は、Mozc が追加されていません。

DefaultIM=keyboard-us
Items/0: keyboard-us のみ

手順7の方法で Mozc を追加してください。

US キーボードでの切り替えキー設定

デフォルトは Ctrl+Space ですが、fcitx5-configtool の「全体の設定」タブで変更できます。

おすすめの設定例:

  • Ctrl+Space — 一般的
  • `Alt+`` — macOS 風
  • Caps Lock — Caps キーを IME 切り替えに割り当て

まとめ

fcitx5 + Mozc の組み合わせは、Ubuntu 24.04 + GNOME 環境で安定して動作し、様々なアプリケーションとの互換性も高いです。特に開発者が使う Electron 系アプリでの日本語入力問題を回避できるのが大きなメリットです。

参考

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?