Error setting kb layout with `setxkbmap`

17,416

Solution 1

My mistake was assuming that the keyboard layouts that were important were the ones in the vm (/usr/share/X11/xkb/symbols/).

Actually, when using x-forwarding it is the keyboard layouts defined in my x server, xming (C:\Program Files (x86)\Xming\xkb\symbols) that are important, and colemak is not included with xming by default. I was able to just download the colemak definition and drop it in the xming symbols folder; then it works as expected.

Solution 2

It's strange, I can correctly switch to colemak with your command:

#> setxkbmap -v us -variant colemak
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of layout variant
         Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us(colemak)+inet(evdev)
geometry:   pc(pc105)

but I can't if I try to keep my Italian variant:

#> setxkbmap -v it -variant colemak
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of layout variant
         Using command line, ignoring X server
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+it(colemak)+inet(evdev)
geometry:   pc(pc105)
Error loading new keyboard description

I'd suggest to you this article, but given that you don't have any desktop manager installed it will be pretty useless.

However, the motivation should be this one:

#> grep colemak /usr/share/X11/xkb/symbols/*
/usr/share/X11/xkb/symbols/gb:xkb_symbols "colemak" {
/usr/share/X11/xkb/symbols/gb:    include "us(colemak)"
/usr/share/X11/xkb/symbols/lv:// http://colemak.com/
/usr/share/X11/xkb/symbols/lv:xkb_symbols "colemak" {
/usr/share/X11/xkb/symbols/lv:xkb_symbols "apostrophecolemak" {
/usr/share/X11/xkb/symbols/lv:  include "lv(colemak)"
/usr/share/X11/xkb/symbols/ph:// http://colemak.com
/usr/share/X11/xkb/symbols/ph:xkb_symbols "colemak" {
/usr/share/X11/xkb/symbols/ph:xkb_symbols "colemak-bay" {
/usr/share/X11/xkb/symbols/us:// 2006-01-01 Shai Coleman, http://colemak.com/ . Public domain.
/usr/share/X11/xkb/symbols/us:xkb_symbols "colemak" {

I can choose the colemak layout among gb, lv, ph and us languages only. You should have a similar problem.

At the end of the story, you can do two things: select colemak for a language close to us that you have installed (e.g. uk or gb), or try to install colemak support for us language via command line (I really don't know how, sorry).

Share:
17,416

Related videos on Youtube

Gabe Moothart
Author by

Gabe Moothart

Updated on September 18, 2022

Comments

  • Gabe Moothart
    Gabe Moothart over 1 year

    I have x11-forwarding set up from an ubuntu 12.04 vm to my (windows) laptop. It works, but when I type in the forwarded applications, it is using the qwerty layout and I would like it to use colemak.

    I would like a command-line solution since I don't have the GUI installed in the vm.

    I have tried setxkbmap -v us -variant colemak, but I get "Error loading new keyboard description":

    $ setxkbmap -v us -variant colemak
    Warning! Multiple definitions of keyboard layout
             Using command line, ignoring X server
    Warning! Multiple definitions of layout variant
             Using command line, ignoring X server
    Trying to build keymap using the following components:
    keycodes:   xfree86+aliases(qwerty)
    types:      complete
    compat:     complete
    symbols:    pc+us(colemak)
    geometry:   pc(pc101)
    Error loading new keyboard description
    

    I also tried setxkbmap -v us -variant dvorak, which did seem to work.

    What is wrong? Colemak comes with ubuntu, and I can see a section for it in /usr/share/X11/xkb/symbols/us, which is where the layout is defined, I assume.

  • Gabe Moothart
    Gabe Moothart over 11 years
    Thanks. This didn't solve my problem, but it pointed me in the right direction. Looks like it is my X server (xming) that needs colemak installed, and not the vm.
  • ezuk
    ezuk about 9 years
    ... a few years later: What definition did you download, if you still remember? :)
  • Gabe Moothart
    Gabe Moothart about 9 years
    The layout is available at colemak.com/Unix
  • ezuk
    ezuk about 9 years
    Thanks Gabe! I've since found it. I actually grabbed the one from DreymaR's big bag of tricks forum topic, as that gave me the full directory, and got it working.
  • WesternGun
    WesternGun almost 6 years
    When you say that "you can only use colemak with some language/locale", it occurs to me that the variant and language settings are found in /usr/share/X11/xkb/rules/, in base.lst and base.xml. There you can find the whole list of variants of languages, maybe you can customize which language can use colemak. Just a guess but very much possible.
  • WesternGun
    WesternGun almost 6 years
    Actually, I find that xkb_symbols is the name of variant of some keyboard layout under some language. If you examine some file, like es under /usr/share/X11/xkb/symbols, you can see that the first one is the base, with default in the first line, xkb_symbols is always basic, and others will not have default in the definition, and xkb_symbols will have distinct names. So, I guess you can load a keymap with setxkbmap xxx -variant colemak. Before that, ensure the keymap file us has a section of xkb_symbols "colemak" actually present.
  • AmanicA
    AmanicA about 2 years
    for TcXsrv I could update my launch file with something like this: vcxsrv.exe -multiwindow -clipboard -wgl -ac -xkbmodel pc105 -xkblayout us -xkbvariant colemak