views:

171

answers:

2

Let's take an example. When I run:

xkbprint $DISPLAY keyboard.ps

what happens in the system? I would like to know how the X really work because I regularly get nasty error reports such as

Fatal Error: Cannot load geometry for /tmp/launch-NawGIk/:0

             Exiting

I know that the X11 was designed in a way that it is easy to extend. But how? How does the X11 protocol work? How do the X extensions work?

+3  A: 

Whatever happens, I'm pretty certain it isn't going to be what you expect.

The syntax of xkbprint(1) is

$ xkbprint sourcefile destfile

and sourcefile should be a compiled xkb file. $DISPLAY is going to resolve to something like mymachine:0.0, which isn't a very reasonable file name.

Actually, since you're running a Mac, it's echoing exactly what it's seeing: /tmp/launch-NawGIk/:0 is the special OS/X magic to let launchd run X apps. The error message means that it's not finding a geometry or display in that file. Which is no surprise since there is no file named `/tmp/launch-NawGIk/:0

Try reading the man page, and see if you don't have more luck with a compiled .xkm file.

More generally, if you want a starting introduction to X, try this article.

Charlie Martin
Or start reading http://en.wikipedia.org/wiki/X_Window_System.
lothar
My man xkbprint says: "The source can be any compiled keymap (.xkm) file that includes a geometry description or an X display specification. ". He should probably express his display specification more precisely to remove confusion with file path.
No, that display spec is exactly the Mac standard. That lets launchd interpret the "file path" as a display for X; it results in launchd starting an X server if none is running.
Charlie Martin
+1  A: 

Man xkbprint says:

The xkbprint comman generates a printable or encapsulated PostScript description of the XKB keyboard description specified by source. The source can be any compiled keymap (.xkm) file that includes a geometry description or an X display specification.

As Charlie Martin pointed out, xkbprint is misusing your $DISPLAY as a file name. Try specifying the display more precisely, to avoid ambiguity with file name. Try man xhost. Maybe passing simple ":0" will fix the problem?