My goal is to create a keyboard map that I can switch via the GUI (here gnome on Ubuntu 19.10, but I have also tried with Xfce and got the same problem, so I am assuming this is xkb rather than Gnome/Xfce related).


I've placed a symbols file in /usr/share/x11/kbd/symbols, let's call it enT. (The file is available here https://github.com/bjohas/Ubuntu-keyboard-map-like-OS-X/blob/master/maps/enT, but I believe the actual content of the file makes no difference, hence not reproduced here.)

I can change the keyboard layout by using

setxkbmap enT

which works as expected.

I've also added a variant entry referring to enT to evdev.xml, which means that the map now appears in the GUI as an available keyboard map. However, when I select the map from the GUI, it doesn't work.

My suspicion is that just placing the new map into /usr/share/x11/kbd/symbols and making the change to evdev.xml isn't sufficient, but that I perhaps need to create a fuller description and place that somewhere?

E.g. is there something I should be doing with the output of setxkbmap enT -print, which gives?

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+enT+inet(evdev)"    };
    xkb_geometry  { include "pc(pc105)" };

Any help appreciated!

  • You did not mention xkbcomp.
    – user373503
    Dec 2, 2019 at 17:56
  • Thanks - I've seen xkbcomp, but I'm not quite sure what to do with the output it generates... how does that work?
    – bjohas
    Dec 2, 2019 at 23:41
  • I only tested it once, It looks like it depends what the target is. Both man pages (setxkbmap and xkbcomp) talk about how they can work together. setxkbmap us -print | xkbcomp - $DISPLAY is a special case but it shows the two steps. unix.stackexchange.com/questions/546630/… I got 100 bonus point. for nothing much, just to give you an impression what to expect on XKB questions here.
    – user373503
    Dec 3, 2019 at 4:01
  • Thank you - that's helpful. How does it help with GUI-based switching? Instead of piping to xkbcomp, should the output be stored somewhere?
    – bjohas
    Dec 4, 2019 at 14:31


Your Answer

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

Browse other questions tagged or ask your own question.