5

I'm using Lubuntu 11.10. I tried the keyboard layout applet from lxpanel but it does not work and I don't know why.

I can change the layout to Russian using

$ setxkbmap ru

and it works! Nice! But the problem is: how to set it back to br using the Russian characters? That is, what should I type on a Russian keyboard to get the same result as

$ setxkbmap br
3

This is, as I discovered some time ago, tricky business with the Russian layout :) - but tricky only because you have cyrillic letters coming up in console and do not know the current keyboard shortcut to switch the layout. Good news is that everything set by setxkbmap will only persist till you logout, then defaults will come back on the next time. That is also why I prefer to get one of the keyboard switching applets working.

However in your case if you use:

localectl set-x11-keymap br,ru grp:alt_shift_toggle

or setxkbmap "br,ru" "grp:alt_shift_toggle"

you should be able to perform switching with Alt+Shift combination, despite not having a working applet. It should work with more than 2 layouts too. This will only persist until logout, however if you edit /etc/vconsole.conf - the changes will pesrist.

KEYMAP="br,ru"
KEYMAP_TOGGLE="grp:alt_shift_toggle"

However this will only work with systemd startup - like in Fedora (which I happen to use). Ubuntu 11.10 does not yet use systemd. In that case you can either edit xorg.conf or /etc/hal/fdi/policy/10-keymap.fdi but an easier solution would be to invoke setxkbmap as you start your x session:

in file ~/.xsessionrc

You put command:

setxkbmap "br,ru" "grp:alt_shift_toggle"

That should sort it for you.

  • This command also returns to default after logout? – Sigur Dec 23 '13 at 11:30
  • localectl command not found. Should I install something? – Sigur Dec 23 '13 at 14:36
  • sorry, I did not pay attention that ubuntu 11.10 does not use systemd – r0berts Dec 23 '13 at 23:45
  • I inserted setxkbmap "br,ru" "grp:alt_shift_toggle" in my file ~/.bashrc since I don't have ~/.xsessionrc. But now how can I use it? Alt+Shift does nothing. – Sigur Dec 24 '13 at 0:07
  • ~/.bashrc gets read when you launch Bash shell. So this is not what you want. ~/.xsessionrc gets read by your xsession. If you don't have the file, just create it. touch ~/.xsessionrc and then edit it. Also have a look at knoppix.net/forum/… Note that you can experiment with quotes, etc - syntax in this link is a bit different. – r0berts Dec 24 '13 at 18:22
1

how to set it back to br using the Russian characters?

why not add:

alias вернуть-раскладку='setxkbmap -layout br'

or any other alias typed with Russian characters to your liking to ~/.bashrc?

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.