Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

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'

share|improve this question
up vote 5 down vote accepted

Try that last one, i.e.:

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

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

share|improve this answer
    
You saved my life. Thank you! – Rnhmjoj Aug 31 '15 at 3:30

Your Answer

 
discard

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.