...making Linux just a little more fun!

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | Knowledge Base | News Bytes -->

The Answer Gang

By Jim Dennis, Jason Creighton, Chris G, Karl-Heinz, and... (meet the Gang) ... the Editors of Linux Gazette... and You!

(?) How do I get a non-US keyboard mapping in Xnest?

From Matthias Arndt

Answered By: Thomas Adam

Dear Answer gang,

it has been more than 4 years that I am reading (and sometimes publishing in) the Linux Gazette with real pleasure. I always did find most answers to my questions here but this time I'm really stuck.

From time to time I use the Xnest command to connect to remote boxes with graphical login.

This works much as expected except for one thing: I'm used to a german keyboard layout and my local X server is configured to use it. But Xnest does not use it - I always get US keyboard layout inside Xnest. For example I tried:

$ Xnest :1 -broadcast -xkbmap de -geometry 980x680
Cannot open "keymap/de" for reading
(EE) Error opening keymap file de, reverting to defaults

for example but I got above error and still only got a US keyboard inside. The rest was working as expected. Another try was something like this:

$ Xnest :1 -broadcast -xkbmap /etc/X11/xkb/keymap/xfree86 -geometry 980x680

Cannot open "keymap/etc/X11/xkb/keymap/xfree86" for reading
The XKEYBOARD keymap compiler (xkbcomp) reports:
 > Error:            Cannot open
"/var/tmp/etc/X11/xkb/keymap/xfree86.xkm" to write keyboard description
 >                   Exiting
(EE) Couldn't load XKB keymap, falling back to pre-XKB keymap
(EE) Error opening keymap file /etc/X11/xkb/keymap/xfree86, reverting to

The main question is: how do I need to call/configure Xnest that it will use my german keyboard setup inside the Xnest window so that I can use remote applications with my german keyboard?

I'm using SuSE Linux 9.1 with XFree86 Version (4.4.0 RC 2) and the according version of Xnest.

(!) [Thomas] The problem you have, Matthias, is that Xnest does not support the -xkbmap inherently. Yes, although Xnest will emulate a server, at present Xnest is only capable of using its own default keyboard extension map.
You have to remember that Xnest is a complex program. To the Xserver and indeed any other Xclient, it looks and behaves as such (it looks like an Xserver to the underlying real Xserver, and as an Xclient to the windows mapped to it) [1]. The reason why the -xkbmap is ignored is because when Xnest loads, it changes the keyboard layout procedures of the real server to its own defaults [2]. Currently there is no pure workaround, other than you might be able to use Xmodmap from within Xnest to change it (or possibly Xkeycaps).
I realise I've been vague about some points, but this is a really complex issue that I might (if the interest is high enough) turn into an article or TAG entry.
  1. This has several inherent problems, that I'll skip.
  2. To many people, this is complex to work around -- but think about. Xnest is both an Xclient and an Xserver (in this sense). The kdb extensions are inherently supplied and then dropped by the real Xserver. It's a transparent process only.

This page edited and maintained by the Editors of Linux Gazette
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

Each TAG thread Copyright © its authors, 2005

Published in issue 114 of Linux Gazette May 2005

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | Knowledge Base | News Bytes -->