Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How do I switch layout with Ctrl+Shift, Alt+Shift or such in LXDE?

All else being equal, I would prefer:

  • a command-line solution
  • a desktop environment-independent solution

so that I can automate my next installation of Ubuntu to include it by default, and so that the recipe still works if I will be actually using another desktop environment in the future.

I am using Ubuntu 13.10 32-bit with LXDE installed. I would like to be able to cycle through English and Russian layouts with Ctrl+Shift (as I already do in Unity).

Currently, when I go to "Preferences" --> "Keyboard Input Methods" I see the following (note that I have only managed to add Ctrl+z as a shortcut to switch layouts, which is not what I wanted):

enter image description here

Then, when I click ellipsis (note the line "Control z" that you can see via a tiny crack of a window under "Keyboard shortcuts"):

enter image description here

share|improve this question

1 Answer 1

You can try this:

Open a terminal and run:

sudo nano /etc/default/keyboard

(or use some other text editor)

Do following changes in the file:

XKBLAYOUT="ru,us"
XKBVARIANT=""
XKBOPTIONS="grp:ctrl_shift_toggle"

Restart and try again.

But the problem is that every desktop environment has his method to override this default settings, the methods are all different. In Lubuntu (14.04) as example the file $HOME/.config/lxpanel/Lubuntu/panels contains the settings for the layout plugin and it must be set to KeepSysLayouts=1, so the default settings are not overridden.

share|improve this answer
    
I wonder if maybe I could just rely on X keyboard layout switching if I won't enable desktop environment's mechanisms? (which are supposedly off by default, as there is no keyboard layout indicator by default). I guess I have to try this out on a fresh install or a virtual machine, to be sure. –  Nickolai Leschov Jun 8 at 19:58

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.