4

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 though 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"
  • try a full path to keymap file – Costas Nov 10 '14 at 16:14
  • @Costas Tried it. Doesn't work. – Robert Siemer Nov 10 '14 at 16:16
  • Sorry for my inattention. Suppose above format of your keymap file is for xkbcomp only. For setxkbmap should be something like XKBLAYOUT="us,ua" etc. – Costas Nov 10 '14 at 16:25
  • @Costas I updated my question. – Robert Siemer Nov 10 '14 at 16:28
3
-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
  • When running from command-line, we can give setxkbmap -option to reset all options set before. How can I achieve this in the configuration file? I tried giving just Options = and Options = "". The former throws an error and the latter doesn't work. – Hashken Apr 9 '15 at 23:37
  • @Hashken - I don't think the config file could reset the configuration to default. It's purpose is to load a keyboard configuration and that's all it does. However, if you load a config file after another one then yes, the options in the second file will not overwrite the old ones but will be added to the existing ones. I guess one way to avoid that would be to prepend your options with a comma e.g. Options = ",grp:alt_shift_toggle" or use Options = "," to delete the old ones and load none. – don_crissti Apr 10 '15 at 0:10
  • Hmm.. Makes sense. I also tried having several Options lines so as to have one setting per line. This is pretty useful to have comments on the side explaining the function. But unfortunately, if multiple Options line are given, only the last seems to take effect. Is there a way to give different Options in different lines? Also, where I can refer for the complete format of this configuration file? – Hashken Apr 10 '15 at 1:07
  • @Hashken - the only documentation that I know of is this page – don_crissti Apr 10 '15 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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