The officially official Devuan Forum!

You are not logged in.

#1 2022-11-23 11:56:07

delgado
Member
Registered: 2022-07-14
Posts: 212  

[SOLVED] How to set keyboard layout in a remote X session?

Hi,

when I'm at home, having a wire guard vpn connection to the company, via remote-desktop to xrdp (virtual session, not screen mirror): The keyboard layout switches to 'en_US'.

The reason is unknown, this does not happen when the connection comes form a local machine. Anyway.

I used to have a German keyboard, anything else is English / en_GB.
To switch back to the layout:

$ setxkbmap -layout "de" -nodeadkeys   # same with or without 'nodeadkeys'

This works not 100%. The [Altgr] key stays dead, which means none of {[]}\| .

What am I missing? Or
How to get the [Altgr] key working?

Thanks and regards.

Offline

#2 2023-01-06 12:14:08

delgado
Member
Registered: 2022-07-14
Posts: 212  

Re: [SOLVED] How to set keyboard layout in a remote X session?

Update:
The original post was not very precise: xrdp is the problem.
And I found a somewhat dirty hack to fix the keyboard layout.

The loaded keymap is:

sudo cat /var/log/xrdp.log | grep km-000 | tail -1
[20230106-12:31:06] [INFO ] Loading keymap file /etc/xrdp/km-00000409.ini

Which is "us". "de" is "km-00000407.ini".
Backup and copy:

sudo gzip /etc/xrdp/km-00000409.ini
sudo cp /etc/xrdp/km-00000407.ini /etc/xrdp/km-00000409.ini

After logging in, it is still a "us" keymap, but switching to "de" now works

setxkbmap de

Would prefer a cleaner solution, but at least it works by now.

Edit: Will mark it as solved. And look for another remote X session solution.

Last edited by delgado (2023-01-06 12:25:09)

Offline

#3 2023-02-07 23:23:09

guuml.dev1
Member
Registered: 2018-12-09
Posts: 21  

Re: [SOLVED] How to set keyboard layout in a remote X session?

delgado wrote:

…  And look for another remote X session solution.

Some weeks ago I have read in setxkbmap(1):

USING WITH xkbcomp
If you have an Xserver and a client shell running on different
computers and some XKB configuration files on those machines are
different, you can get problems specifying a keyboard map by model,
layout, and options names. …

For example, the command …

      setxkbmap us -print | xkbcomp - $DISPLAY

makes both steps run on the same (client) machine and loads a keyboard
map into the server.

Note the "us" difference to an example setting with de_DE.UTF-8:

$ setxkbmap -print
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwertz)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+de(nodeadkeys)+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

Using the command

setxkbmap de nodeadkeys -print | xkbcomp - $DISPLAY

should provide a german keyboard (with no deadkeys) to the server.


guuml is an abbrevation for gü in ASCII (1967),
focused on devuan and skipping epic poems like beowulf.
Has Gü spent his last raw DVD to a chimäre? No.

Offline

#4 2023-04-22 12:38:14

delgado
Member
Registered: 2022-07-14
Posts: 212  

Re: [SOLVED] How to set keyboard layout in a remote X session?

@guuml.dev1: Thanks for the reply (yes, long ago). There are "ä,ö,ü,ß". [AltGr] is onyl working, if xrdp uses an appropriate keymap too.

Update - a cleaner way to set a default keymap for xrdp:
Initially loaded is /etc/xrdp/km-00000000.ini. The file is not existing, so a link or copy can be made without interfering the installation. The issue occurred again on a new PC.
In my case:

$ sudo cp -a /etc/xrdp/km-00000407.ini /etc/xrdp/km-00000000.ini

After logging in, it is still a "us" or "en" keymap, but switching to "de" now fully works.

$ setxkbmap de

Offline

Board footer