Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my distribution (Slackware 13.37), the console keyboard layout is chosen among some of those available in /usr/share/kbd/keymaps ' sub directories, coming from the kbd package.

Under X instead the keyboard layout is chosen in a "layout" list included in the file /etc/X11/xkb/rules/evdev.lst.

Does anybody knows a way to, given some console keyboard layout, map it to an X keyboard layout, in order to set up accordingly the "XkbLayout" option in an X configuration file?

I am specially interested in knowing the way other distributions than Slackware deal with this for initial configuration.

share|improve this question

Well, how I understand it, in Debian, in /etc/default/keyboard you set the variables XKB{MODEL,LAYOUT,VARIANT,OPTIONS} with values you would use for XKB.

Then, at bootup, setupcon(1) reads those variables and calls ckbcomp(1), which, as its manpage says, “compile[s] a XKB keyboard description to a keymap suitable for loadkeys or kbdcontrol“.

Finally, loadkeys(1) is called on the compiled file.


(Or maybe you meant the opposite. I'm not really sure now...)

share|improve this answer
Slackware 13.37 doesnt have /etc/default/keyboard – LnxSlck Sep 9 '12 at 17:42

There is no magic, the distributions just have to maintain an array of triplets: "keyboard layout text description", "console keyboard layout options", "X11 keyboard layout options", and provide a tool to select and configure the layouts.

If the distribution doesn't do that, then it is up to the user to manually configure console and X11 keyboard, and thus up to the user to make them coherent together.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.