0
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?

More than 5 years have passed since last update.

Ubuntu の xkb のキーボード設定を直したい

Last updated at Posted at 2019-12-16

概要

キーバインドを色々いじろうと xkb の設定ファイルをいじっていたら設定が破損してしまい、

  • 立ち上げるときにUbuntuロゴからログイン画面が表示されるまでの間に何やらメッセージが表示される
  • 日本語 JIS キーボードのレイアウトが認識されない(USキーボードになってしまう)

という状況になってしまったので、試行錯誤の末修復した話。
メモ書きとして残しておきます。

環境


$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"

対処

結論から言うと、xkb-data パッケージをインストールし直したら直りました。

$ sudo apt-get install --reinstall xkb-data
$ reboot

なにをしたら破損したか

/usr/share/X11/xorg.conf.d 以下に下手な設定ファイルを作成したら、冒頭に書いたような症状になってしまいました。
作成したのは次のようなファイルです。

Section "InputClass"
    Identifier "keyboard defaults"
    MatchIsKeyboard "on"

    Option "XkbRules" "evdev"
    Option "XKbModel" "pc105"
    Option "XkbLayout" "jp, us"
    Option "XkbVariant" ","
    Option "XkbOptions" "caps:hyper,hjkl:direction"
    # 自分で作成した"hjkl:direction"というオプションを読み込ませようとした
EndSection
0
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
0
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?