There are no examples in the manual and every file I've tried needs some geometry.

$ xkbcomp /usr/share/X11/xkb/symbols/ua tmp/ua.xkm

$ xkbprint tmp/ua.xkm
Cannot open "tmp/ua.xkm" to read geometry

$ xkbprint /usr/share/X11/xkb/symbols/ua
Error: Couldn't read geometry from XKM file "/usr/share/X11/xkb/symbols/ua"
up vote 3 down vote accepted

To build on gioele's answer, to preview custom keyboard layout, you can also use xkbcomp like this:

setxkbmap ua -print | xkbcomp - - | xkbprint - - | ps2pdf - > ua.pdf

ua being the desired keyboard layout.

Inspect setxkbmap -print — it provides xkbcomp with geometry, symbols, keycodes, ...

The source can be ... or an X display specification.

xkbprint :0 -o

  • 1
    for viewing directly in bash: zathura <(xkbprint :0 -o - | ps2pdf -) – Janus Troelsen Apr 27 '15 at 12:41

The problem is that your are compiling with xkbcomp a symbol table, not a geometry.


$ xkbcomp /usr/share/X11/xkb/geometry/ua - tmp/ua.xkm
$ xkbprint -color tmp/ua.xkm

or (without temp files and with a PDF output):

$ xkbcomp /usr/share/X11/xkb/geometry/ua - | xkbprint -color -o - - | ps2pdf - > ua.pdf

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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