How can I add a custom xkb layout

czarkoff at gmail.com czarkoff at gmail.com
Mon Jul 5 12:13:29 PDT 2010


Hello!

I'm using X.Org X Server 1.6.5. I tried to add a custom XKB layout for serbian
on US keyboard. So, I've added the following to "/etc/X11/xkb/symbols/us":

// Serbian charecters added as third level symbols to US keyboard layout.

partial alphanumeric_keys
xkb_symbols "serbian" {

  name[Group1]= "USA - Serbian";

  include "us(basic)"
  include "level3(ralt_switch)"

  key <TLDE> { [ grave, asciitilde ] };
  key <AE06> { [ 6, dead_caron, asciicircum, asciicircum ] };
  key <AC09> { [ l, L, U1C9, U1C8 ] };
  key <AB06> { [ n, N, U1CC, U1CB ] };
  key <AB01> { [ z, Z, U1C6, U1C5 ] };
  key <AD03> { [ e, E, EuroSign, cent ] };
  key <AC03> { [ d, D, dstroke, Dstroke ] };
  key <AC11> { [ dead_acute, quotedbl, apostrophe, U315 ] };
  key <SPCE> { [ space, space, nobreakspace, nobreakspace ] };

};

At the same time I've added following to the "/etc/X11/xkb/rules/xorg.lst":

  serbian         us: Serbian on US keyboard

And to the "/etc/X11/xkb/rules/xorg.xml" (to the us layout):

        <variant>
	  <configItem>
	    <name>serbian</name>
	    <description>US keyboard with Serbian support</description>
          </configItem>
        </variant>

After restarting X I've got:

% setxkbmap -layout us -variant serbian -v 10
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
         Using command line, ignoring X server
Warning! Multiple definitions of layout variant
         Using command line, ignoring X server
Applied rules from xorg:
model:      pc105
layout:     us
variant:    serbian
options:    grp:caps_toggle
Trying to build keymap using the following components:
keycodes:   xfree86+aliases(qwerty)
types:      complete
compat:     complete+ledcaps(group_lock)
symbols:    pc/pc(pc105)+pc/us(serbian)+group(caps_toggle)+group(caps_toggle)
geometry:   pc(pc105)
Error loading new keyboard description

I'm sure I've done something wrong, but I can't get what exactly. Anyone
knows?

Thanks in advance.

--
Dmitrij D. Czarkoff



More information about the xorg mailing list