8

I switched to Russian keyboard via loadkeys ru command and now cannot switch back.

A directory and subsequent files I have are titled in Cyrillic characters and I am trying to get to them by a combination of commands in Latin characters and Cyrillic ones. So far I've been stuck on Cyrillic.

Does anyone know how to switch back if I have only Cyrillic characters available?

3

I feel there must be a much more logical/sane solution compared to what I'm about to propose, such as running sudo loadkeys us from the graphical terminal whose layout is independent, or restarting the machine (as already suggested).

If none of those are an option, however, you could use the following pants-on-the-head technique:

  1. Find the original line in shell history with the key. It should be sudo loadkeys ru. Alternatively, find any line that has u and s in it.
  2. Remove all characters except for us. Press Enter. (Bash will complain that command not found.)
  3. Now go back to your loadkeys ru line.
  4. Press Alt+/. In the Russian layout / is mapped to .. And Alt+. is mapped yank-last-arg in bash, which is the command that inserts the last argument from the previous command. In this case, it will be us that we've assembled in the previous step.
  5. This should leave you loadkeys us. All it takes now is to press Enter.

If it happens that there are no commands with both u and s in them, you could do steps 2 and 3 twice, and pick those characters from 2 different commands.

| improve this answer | |
2

The Russian keymap probably has a modifier key for Latin text.

Some likely suspects are the Caps Lock key (Latin lock), the right Alt (AltGr) key, or possibly the combination of Alt and Shift together.

If you could look at the keymap file (or run dumpkeys) then you'd know for sure. But it might be difficult to find information while your keyboard is stuck in an unfamiliar mapping!

The keymap file

The comment at the top of /usr/share/keymaps/i386/qwerty/ru.kmap.gz in Ubuntu 16.04 LTS (Xenial Xerus) says:

"Cyrillic" mode is toggled by Right_Ctrl key and shifted by AltGr key.

I hope your keyboard has a right-Ctrl key! If it doesn't, you'll need to hold down right-Alt (AltGr) while you switch.

| improve this answer | |
  • 1
    This is the right approach! Unfortunately, not all keyboards have AltGr either. I think European and UK/AU/NZ keyboards have it, while for instance US and RU keyboards simply have two Alt keys by default (one of which can be remapped to AltGr nonetheless, though.) – undercat applauds Monica Feb 27 '18 at 7:42
1

Have you tried the standard(ish) shortcut that is ctrl+space ?

If, when installing a new keyboard you didn't suppress the English one, this shortcut should switch between one and the other.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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