31

I've tried changing the session keyboard but it doesn't work. If I go

Settings → Settings Manager → Keyboard → Layout (tab at top) → uncheck Use System Defaults → Delete the current keyboard / add a new one

I find that when I log back on the correct keyboard is still not working.

Evan Carroll
  • 7,526

6 Answers6

57

You can change the setting for default system keyboard hardware (e.g. "Generic 105-key keyboard" to "Generic 101-key keyboard") and also the system keyboard layout (e.g. "us-intl" to "us") with the command

sudo dpkg-reconfigure keyboard-configuration
unutbu
  • 1,072
11

view this file /usr/share/console-setup/KeyboardNames.pl. In it you'll see a Perl Hash of Hashes:

  'us' => {
'Cherokee' => 'chr',
'English (Colemak)' => 'colemak',
'English (Dvorak alternative international no dead keys)' => 'dvorak-alt-intl',
'English (Dvorak international with dead keys)' => 'dvorak-intl',
'English (Dvorak)' => 'dvorak',
'English (Macintosh)' => 'mac',
'English (US, alternative international)' => 'alt-intl',
'English (US, international with dead keys)' => 'intl',
'English (US, with euro on 5)' => 'euro',
'English (classic Dvorak)' => 'dvorak-classic',
'English (international AltGr dead keys)' => 'altgr-intl',
'English (layout toggle on multiply/divide key)' => 'olpc2',
'English (left handed Dvorak)' => 'dvorak-l',
'English (programmer Dvorak)' => 'dvp',
'English (right handed Dvorak)' => 'dvorak-r',
'Russian (US, phonetic)' => 'rus',
'Serbo-Croatian (US)' => 'hbs',
  }

Let's say you want

'English (international AltGr dead keys)' => 'altgr-intl',

Instead of

'English (US, international with dead keys)' => 'intl',

Firstly, see that they all fall under us. Now edit /etc/default/keyboard and change this

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT="intl"
XKBOPTIONS=""

to

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT="altgr-intl"
XKBOPTIONS=""
Evan Carroll
  • 7,526
  • An even better way to find out system name of the keyboard you want to use is with localectl list-x11-keymap-variants us – Arsen Zahray Nov 25 '21 at 02:12
0

I realize it has been 7.5 years since this question was asked, but I found it today when I had the same issue. I came up with this very simple solution that worked for me on Ubuntu 16.04:

Open system settings -> text entry

You will see your input sources ("keyboards") listed in a window on the left side. If you want to add more keyboards, press the bottom-left "+".

Here is the trick: Once you have all your desired keyboards, use the up-down arrows at the bottom of that window to arrange the keyboards in your order of choice. The one at the top of the list will be your default keyboard, and you will move along this list when you switch keyboards when pressing Super+Space.

After doing this I logged out and then also restarted the system. The change seems permanent.

I hope this helps people, despite the long time past.

Mau
  • 1
0

The "one on the top" does not work in Linux 20 with Cinnamon. Every time after rebooting, I get the 2nd (bottom) key-mapping, with dead keys.

0

In ubuntu 14.04, Open system settings > Text Entry ( or Search for it with the Super key and type 'Text Entry' to find it)

Click the plus in the lower left

Select the language (e.g. English(Dvorak), English(Colemak), etc)

To switch between layouts, Super+Space is the default switcher. The mouse can be used to select the text entry method in the up right, shown with an abbreviation for the language.

For English, it will appear as En. For multiple English layouts a subscript appears to differentiate them. Other language key-mappings have a different abbreviation.

-1

Delete all languages except one you want to make default, then add deleted languages back. Worked for me :)