I want to create and set a custom keyboard layout with setxkbmap. I created a file in ~/.xkb/prog with this content:

partial default alphanumeric_keys
xkb_symbols "basic" {

include "latin(type4)"

name[Group1]="es for developers";

key <AE01> {[           1,           exclam,    exclamdown,          bar   ]};    
key <AD03> {[           e,                E,      EuroSign,     sterling   ]};
key <AB06> {[           n,                N,        ntilde,       Ntilde   ]};    
key <AB07> {[           m,                M,            mu,           mu   ]};    
key <AB10> {[       slash,         question,  questiondown,    dead_hook   ]};

include "level3(ralt_switch)"

And I tried to load it with setxkbmap -I$HOME/.xkb "prog", but I get a 'Error loading new keyboard description'

I also tried it with setxkbmap -I$HOME/.xkb "prog" -print | xkbcomp -I$HOME/.xkb - $DISPLAY, but I get this error: 'Can't find file "prog" for symbols include'

1 Answer 1


Try that last one, i.e.:

% setxkbmap prog -print | xkbcomp -I$HOME/.xkb - $DISPLAY

But put your layout in ~/.xkb/symbols/prog (note the symbols subdirectory).

  • Hello @angus, could you look at my question please? Maybe you know better unix.stackexchange.com/questions/414589/…
    – aliopi
    Jan 4, 2018 at 16:35
  • You don't need the first include: your command will not change the setxkbmap settings, just xkbcomp: If you try setxkbmap -print after that, you will not see the modifications you just did.
    – rambi
    Jul 15, 2021 at 11:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .