I want to run a shell command or script that will configure each of my Ubuntu Precise boxes to use the Dvorak keyboard layout as the default (and only) layout. With earlier versions, I was able to set the XKBVARIANT in /etc/default/keyboard but when I make this change in Precise (and reboot), the keyboard layout appears to be unaffected (both in console and in gnome).
I tried also setting the XKBMODEL to pc105 and XKBLAYOUT to us, but that did not seem to help.
I know I can set the layout for gnome using the 'keyboard layout' tool... but I want the change to affect the console, and I want to automate the process. How can I accomplish this?
Edit:
To clarify, I want to know how I can cause to change (using only a script or command-line) the keyboard layout to be Dvorak as the default and only keyboard layout for both Gnome and the console. I want this change to be persistent (survive reboots), just as it is when the change is made through the Keyboard Layout tool.
Edit:
Let me put it another way. If I had installed the operating system myself (which I did not because the OS was installed by the virtual machine infrastructure), I could have selected the desired keyboard layout at install time, and that layout would be applied persistently, system-wide. How can I change the layout to appear as if I had set it during the install process?
/etc/default/keyboard
settingXKBVARIANT="dvorak"
andXKBLAYOUT="us"
and then runsudo dpkg-reconfigure console-setup -u
and reboot, and the console will start up with the dvorak layout. That's half the problem. Now how to do the same for the X session?udevadm trigger --subsystem-match=input --action=change
, the X session does adopt the settings as defined in/etc/default/keyboard
, but if I reboot, the setting is lost. It appears the readme in/usr/share/doc/keyboard-configuration/README.Debian
is incorrect. This may be a bug in Precise.