2

I had added up English(US), Belgian(alternative), Tamil Keyboard layouts using the GUI.

How do I easily switch between these three layouts from terminal?

  • 2
    Answers on the Original question doesn't works for me.I'm running 13.10.But the below answer makes to easily switch between different keyboard layouts which we are added. – Avinash Raj Jan 25 '14 at 2:01
2

In Ubuntu 13.10, if your keyboard layouts are exactly in this order: English (US), Belgian (alternative), Tamil and:

  • if you have set English (US) keyboard layout, then:

    • to change to Belgian (alternative) keyboard layout, use:

      gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'be+oss'), ('xkb', 'in+tam'), ('xkb', 'us')]"
      
    • to change to Tamil keyboard layout, use:

      gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'in+tam'), ('xkb', 'us'), ('xkb', 'be+oss')]"
      
  • if you have set Belgian (alternative) keyboard layout, then:

    • to change to Tamil keyboard layout, use:

      gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'be+oss'), ('xkb', 'in+tam'), ('xkb', 'us')]"
      
    • to change to English (US) keyboard layout, use:

      gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'in+tam'), ('xkb', 'us'), ('xkb', 'be+oss')]"
      
  • if you have set Tamil keyboard layout, then:

    • to change to English (US) keyboard layout, use:

      gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'be+oss'), ('xkb', 'in+tam'), ('xkb', 'us')]"
      
    • to change to Belgian (alternative) keyboard layout, use:

      gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'be+oss'), ('xkb', 'in+tam')]"
      

Obs: These commands works only in Ubuntu 13.10 (and maybe later versions).

2

You can change keyboard layouts using setxkbmap. This is guaranteed to work with any version of Ubuntu. To change to us layout:

setxkbmap us

To change to tamil:

setxkbmap in+tam

to change to Belgian:

setxkbmap be+oss

The preferences will be kept until you close your session or restart the system.

  • That doesn't actually seem to be the case - yes, you can change the layout, but ubuntu will reset it after a short period of time, in my experience (only 13.10 and up). – Fake51 Mar 6 '14 at 14:01
  • @Fake51 he doesn't want to do the change permanent as far I read the question. – Braiam Mar 17 '14 at 11:51
  • Presumably more than 1 minute or first window switch - that's all the persistence I get. – Fake51 Mar 17 '14 at 18:06

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.