How to change the keyboard layout (I have English-Russian set-up, Russian kbd wrong)
I have Debian running in Russian and English.
The Russian keyboard layout isn't the typewriter standard, which I know and much prefer to the one it gives me. NOTE: I am NOT using KDE or gnome. (ratpoison is my windows manager.) I need to solve this via CLI-based solution, I want it to affect the keyboard I get both in ratpoison and in a basic CLI tty (when I'm not in X). How do I do that? Thanks in advance! |
I think "dpkg-reconfigure xserver-xorg" gives options to change the keyboard setting.
|
Presumably not for the non-X tty CLI consoles, though, right?
|
$ setxkbmap ru
I've not used ratpoison but I don't see from what I've checked on the web that setxkbmap should not work with it. How you go on when you are not using an X server ... ? |
ratpoison uses the X-server.
|
How do I use setxkbmap to set ONE variant of the keyboard layout for ONE of TWO installed languages?
$setxkbmap -ru-cp1251, for example, is accepted, but doesn't appear to change anything. |
/usr/share/X11/xkb/rules/xorg.lst
Under: ! layout ... ... ... ... phonetic ru: Phonetic phonetic_winkeys ru: Phonetic Winkeys typewriter ru: Typewriter legacy ru: Legacy tt ru: Tatar os_legacy ru: Ossetian, legacy os_winkeys ru: Ossetian, Winkeys cv ru: Chuvash cv_latin ru: Chuvash Latin udm ru: Udmurt kom ru: Komi sah ru: Yakut xal ru: Kalmyk dos ru: DOS bak ru: Bashkirian So: $ setxkbmap ru -variant typewriter will give the typewriter variant of Russian. |
One should perhaps point out that Gnome has an additional keyboard "layer" so that each application can be set to use a different keyboard. It also means that you don't lose things like Ctrl+C, Ctrl+X, Ctrl+V when you change the keyboard to a non-Roman alphabet.
Unless things have changed recently even KDE works directly on the setxkbmap settings. |
Awesome, r-t... partially.
Yes, that changed the keyboard to the layout I wanted... after which I couldn't switch back to English in X and had to reboot. BUT when I rebooted the computer and restarted X, it was back to where I started. What I want is to preserve the option to switch between RU and EN, but I want to set the RU keyboard layout PERMANENTLY to 'typewriter'. |
Quote:
But, really - everywhere. Ideally, even in the non-X interface. The most crucial thing, though, is to get it working in X, in word processing. |
Well, of course, once you have typed:
$ setxkbmap us or $ setxkbmap gb and $ setxkbmap ru -variant typewriter and any others into the command line, you can use the keyboard up-arrow to select which you want. The other option is to edit xorg.conf (see, for example: http://tech.groups.yahoo.com/group/OmegaT/message/11593 ) and set it to toggle using specified keys. But the "smoothest" option as far as I know is to use Gnome and set things up at Keyboard Preferences with a Keyboard Indicator in the desktop tray/panel. (Unless you are talking about Java applications!) |
I set up Debian with the 2 kbds.
I did go into xorg.conf and saw a "variant" section in the section on the RU keyboard. I changed it to "typewriter"... but it doesn't work. By which I mean that it shifts to the same Russian keyboard layout it had before. |
Perhaps you put the variant in brackets as here:
http://www.daemonforums.org/showthread.php?t=1830 My xorg.conf on Fedora however has no keyboard information in it at all – it just seems to be used to set up the nVidia video card. |
OK, largely (but NOT completely) solved!
In xorg.conf, the point isn't to make the "XKBVariant" variable read "typewriter," but to have the "XKBLayout" variable read "us,ru(typewriter)" It is the addition of "(typewriter)" that did the trick! BUT one thing is left: How do I affect/alter the choice of the layout of the Russian keyboard when I hit alt-shift and I'm *NOT* in X? Just in a tty? The choice IS, somehow, being made. Thanks, all! |
Looks like that question has drawn a bit of a blank before:
http://www.linuxquestions.org/questi...layout-278253/ Although from this post it looks as if "loadkeys" is necessary: http://www.linuxquestions.org/questi...d-line-499375/ |
r-t, you've been a great help, thanks, and that would probably work, and I appreciate the research.
But I ask you: since I already can switch between the two keyboards in tty as soon as I log in, doesn't it follow that there must be something, almost certainly in a text file used at start-up, that selects the keyboard layout to use for Russian? And if that's so, shouldn't it be possible just to change that setting? It would be cool to do this in the more efficient manner... Thoughts? |
|
If you don't have X running, I think you just have to switch manually with the loadkeys command.
|
/bin/setupcon seems interesting. I wonder whether it might help here.
Or perhaps loadkeys could do this in a BASH script automatically run at set-up. But there must be one that's ALREADY doing this, setting up the keymaps I get at log-in, no? THAT'S what I need to find, isn't it? |
Using the loadkeys command seems to obviate the "shift-alt" set-up to switch between the layouts.
That would be self-defeating. Still not there! |
What I meant is that you had to use loadkeys to do the switch.
You can see the console key files in /lib/kbd/keymaps and they're far less developed than those for X in /usr/share/X11/xkb. Thinking about it, the need to switch from Latin to Cyrillic on the fly is characteristic of activities like word-processing, which are generally going to be done in a GUI environment. Running without X is more likely for systems administration, where you will want to pick a particular language and stick with it. That's why xkb drivers include keys for things like ISO_Next_Group, but the console drivers prefer things like Show_Registers. If you want to set Shift+Alt as ISO_Next_Group, you'll have to re-write a file: probably /lib/kbd/keymaps/i386/include/linux-keys-bare.inc. |
All times are GMT -5. The time now is 06:33 AM. |