1
0

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で日本語(JIS)キーボード配列がUS配列として認識される問題と対処

Posted at

概要

Ubuntu環境で、ログイン画面ではJIS配列が有効だが、ログイン後のセッションではUS配列として認識される不具合が発生。
特にChromeやターミナルでキー配列がズレ、日本語入力が困難になる状態が確認された。


原因

  • GNOME/Wayland環境でXKBレイアウト適用が失敗し、セッション開始時にUS配列へ戻ってしまう既知のバグ。
  • ログイン画面(GDM)とユーザーセッションでキーボードレイアウト設定が別々に管理されていることが影響。

有効な対処

1. Waylandを無効化してXorgに切り替え

/etc/gdm3/custom.conf を編集し、以下の行を有効化:

WaylandEnable=false

再起動後、以下で確認:

echo $XDG_SESSION_TYPE
# → x11 と表示されればOK

2. システム全体のデフォルト配列をJISに設定

/etc/default/keyboard を以下の内容に設定:

XKBMODEL="pc105"
XKBLAYOUT="jp"
XKBVARIANT=""
XKBOPTIONS=""

3. セッション開始時にJIS配列を強制適用

~/.config/autostart/set-jis.desktop を作成:

[Desktop Entry]
Type=Application
Exec=setxkbmap jp
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Set JIS Layout

この設定により、ログイン時に自動で setxkbmap jp を実行し、全アプリでJIS配列を維持できる。


結果

  • Chrome、ターミナル、その他アプリ全てでJIS配列が適用。
  • 再起動後も配列崩れが再発しない状態を実現。

備考

  • gsettingsibus 再起動などの操作は今回の不具合解消には直接効果なし。
  • set-jis.desktop は配列維持のため必須。削除しないこと。
1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?