Setxkbmap – How to Use the ‘-config’ Option

keyboard shortcutskeyboard-layoutx11xkb

I have a keymap file with this content:

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete+numpad(shift3)"   };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "macintosh_vndr/apple(alukbd)+macintosh_vndr/us+inet(evdev)+altwin(swap_alt_win)+capslock(backspace)+compose(rctrl)+macintosh_vndr/apple(alupckeys)+shift(both_capslock)"   };
    xkb_geometry  { include "macintosh(applealu_ansi)"  };
};

I thought I can load it with setxkbmap -config keymap, but I can't.

How are you supposed to use '-config'? How to load a xkb_keymap section?

Edit: I know that I can load it with xkbcomp keymap :0, but still: how does '-config' work?

Edit2: That's the output I get:

$ setxkbmap -v 10 -config ~/xkb/keymap 
Setting verbose level to 10
locale is C
Found file /home/user/xkb/keymap
Couldn't find configuration file "/home/user/xkb/keymap"

Best Answer

-config file
       Specifies the name of an XKB configuration
       file which describes the keyboard to be used.

I think this dates back from the time of xf86cfg. When starting X on multiple VTs one could have different keyboard configurations with per-server keyboard config files:

<Xroot>/lib/X11/xkb/X0-config.keyboard
<Xroot>/lib/X11/xkb/X1-config.keyboard

A keyboard configuration file consists of key = value pairs, one per line. Here is my rather simple test file, /home/don/my-config.keyboard:

Rules    =  "xorg"
Model    =  "pc104"
Layout   =  "fr"
Variant  =  "dvorak"
Options  =  "grp:caps_toggle,grp_led:caps" 

load it with setxkbmap:

setxkbmap -config /home/don/my-config.keyboard

and voilĂ :

setxkbmap -query

returns:

rules:      xorg
model:      pc104
layout:     fr
variant:    dvorak
options:    grp:caps_toggle,grp_led:caps