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.

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?

share|improve this question
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 at 2:01
add comment

2 Answers 2

up vote 2 down vote accepted

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).

share|improve this answer
add comment

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.

share|improve this answer
    
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 at 14:01
    
@Fake51 he doesn't want to do the change permanent as far I read the question. –  Braiam Mar 17 at 11:51
    
Presumably more than 1 minute or first window switch - that's all the persistence I get. –  Fake51 Mar 17 at 18:06
add comment

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.