Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I quickly change my keyboard layout between US and German?

setxkbmap does not apply here, as I only have an SSH shell.

Persistent changes via

dpkg-reconfigure keyboard-configuration
dpkg-reconfigure console-data

are unwanted as well.

I suppose the solution is very simple, but I did not find it.

share|improve this question
1  
Is that SSH shell obtained inside a terminal in a GUI environment? –  enzotib Jan 4 '12 at 18:19
    
no. plain text terminal –  tuergeist Jan 12 '12 at 19:24

2 Answers 2

up vote 10 down vote accepted

Try:

# loadkeys US

From a terminal, it does not make sense to run this over ssh as the keyboard you use over ssh is the local one and the ssh client sends the keys after they have already been interpreted according to your local keymap. And it won't even work if you try.

You can find all the available console keymaps in /usr/share/kbd/keymaps.

share|improve this answer
    
btw, on ubuntu I found keymaps here: /usr/share/keymaps/i386/qwerty, and had to install apt-get install console-data too –  Aquarius Power Apr 28 at 13:54

You mean you want to change the keyboard layout of the console of the machine from which you are launching the terminal; and do it before launching ssh connection; and have that modified keyboard layout have a special key to switch between to modes "us" and "german" ?

Well, by default there isn't any such setting; those layout switching are usually done between latin/non-latin layouts.

You could however take one of those existing settings (for example, the console layout definition for, say, greek keyboard), copy it under another name, edit it and change the greek letter definitions with whatever applies for your wanted "german" layout. Then load that modified layout; and now you can switch between them.

If, on the other hand, you just want to change the layout for the duration of the whole ssh session; just call "loadkeys us" before launching ssh session, as totaam said; and "loadkeys de" after it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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