I'm currently setting up a couple of computers with Ubuntu MATE 16.04. The default installation sets the Keyboard Layout to 'English', however, I need a 'German' keyboard layout. I figured out how to remove all Layouts and add 'German' as default keyboard layout in the GUI.
System -> Preferences -> Hardware -> Keyboard -> Layouts
However, I have to setup around 20 computers and it would be neat if I could script those settings. So my questions is where are the keyboard settings stored such that I could copy it from one computer to all the others.
Best Answer
1. MATE Desktop Environment session
1.1. Using
gsettings
You need the following GSettings keys. Below is my example with two layouts (
us
andru
) using Ctrl+Shift as layout switcher and ScrollLock LED as indicator of the second layout:Edit it for your case.
1.2. Using
dconf
Alternative method is to use
dconf
command:Edit it for your case.
2. Terminal session and some GUI cases
Do not forget to run
sudo dpkg-reconfigure keyboard-configuration
to reconfigure keyboard layouts for terminal and some GUI sessions.It will save its settings in
/etc/default/keyboard
.You can configure it once, then copy this file to other machines. After changing this file you should update initramfs images with
sudo update-initramfs -k all -u
.Also note, that MATE Keyboard Preferences may be opened with
mate-keyboard-properties
.