I am following this1 tutorial about remapping keys in Ubuntu. The tutorial describes how one can remap the CapsLock key using setxkbmap
. Currently I only want to test this by disabling the Caps Lock key:
setxkbmap -option "caps:none"
which works fine. However, it does not store the change permanently. After rebooting, the change is lost. The tutorial recommends to use a file /usr/share/X11/xorg.conf.d/10-keyboard.conf
and enter a InputClass
section:
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "no,us"
Option "XkbModel" "pc105"
Option "XkbOptions" "caps:none"
EndSection
However, on my Ubuntu 16.04 machine there is no file /usr/share/X11/xorg.conf.d/10-keyboard.conf
.
After further googling, I got more confused, as there seems to be wide variety of answers and corresponding recommended files to use. For example, these file have been mentioned
/usr/share/X11/xkb/symbols/pc
/etc/default/keyboard
/etc/default/console-setup
What is the correct way to do this on Ubuntu 16.04?
See also:
Edit:
Creating a new file /usr/share/X11/xorg.conf.d/10-keyboard.conf
as suggested by @GunnarHjalmarsson in a comment, does not work either. However, I tested now setting the option in /etc/default/keyboard
instead:
XKBMODEL="pc105"
XKBLAYOUT="no"
XKBVARIANT=""
XKBOPTIONS="caps:none"
and this seems to work fine! It would be nice if someone could also explain why?
Footnotes:
/usr/share/X11/xorg.conf.d/10-keyboard.conf
file. – Gunnar Hjalmarsson Sep 30 '16 at 21:25/etc/default/keyboard
, and then saw that you already had made it work that way. Don't have a good answer why it works other than the file seems to be central for keyboard configuration on Ubuntu. Available options can be found viaman xkeyboard-config
. – Gunnar Hjalmarsson Oct 01 '16 at 11:49