9

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"
Exiting
5

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, ...

1
  • 1
    Great trick with setxkbmap -layout se -variant dvorak | xkbcomp - - | . Another trick is to use localectl list-x11-keymap-layouts and localectl list-x11-keymap-variants se to see which country layout and variants there are that can be used instead of au, like se(dvorak). Like setxkbmap -layout se -variant 'dvorak' -print | xkbcomp - - | xkbprint -lg1 -color - - | ps2pdf - > se.pdf. – Anders Jul 16 at 18:46
7
The source can be ... or an X display specification.

xkbprint :0 -o xkbprint_output.ps

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

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

Try

$ 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 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.