6

I read this article where is a workaround to add maximum eight keyboard layouts.

But my questions are:

  • I would like to try this, but I see they've written there something with "gnome" in the script. In my Ubuntu, 13.04, I have Unity. What do I do?

  • I would have to do this for four x four keyboard layouts (to have 13 keyboard layouts). This script, however, is designed for two x four keyboard layouts. How do I get the four x four?

I would really appreciate your tips and hints on this. And I would kindly ask you to keep it simple, if possible, because I'm really no expert in both Ubuntu and computers in general.

3
  • Sorry, I find here very dis-encouraging and hard to post :(( . First, I wrote this question already, at the link you see, but a person deleted. I don't understand why :((( . I have very hard effort to write, because I am strongly mentally disabled. And I wrote really very politely and nothing bad. So I don't understand why someonw so bad to me and just deleted :((( ? And no with this new article to post, it was also very difficult to me, beause there was something with "tags", and then he did not accept my tags - it is really very difficult to post here for disabled persons, sorry. Jul 1, 2013 at 16:00
  • What languages do you need to use? In most cases, you can use an international layout or the compose key for diacritics in languages with roman letters and an input method such as ibus for the non-roman languages.
    – chaskes
    Jul 1, 2013 at 16:01
  • Thanks, well, it's just the problem that on the top of Unity desktop, there can be only four languages choosen together. But sometimes, I use English language, sometime Suaheli, somtimes Russian, and also Spanish, Portugese, Turkish and some other. Of course, I do not speak all these languages fluently, but sometimes I have to write for work purposes. So, all in all, I would need 13 different keyboard layaouts and the possibility to easily change among them. Jul 1, 2013 at 16:28

2 Answers 2

2
  • In Ubuntu 13.04 forget about gconftool-2 --get /desktop/gnome/peripherals/keyboard/kbd/layouts and use only this command:

    gsettings get org.gnome.libgnomekbd.keyboard layouts

  • I updated the keyboard-layout-switch script for 4x4 keyboard layouts as follow:

#!/bin/bash

default_layout="['ro', 'gr', 'us\taltgr-intl', 'al']"    
layout_two="['ba', 'de\tdeadgraveacute', 'ph', 'gb']"    
layout_three="['de\tdeadgraveacute', 'al', 'ara', 'be']"    
layout_four="['gb', 'be', 'ro', 'ara']"

current_layout=$(gsettings get org.gnome.libgnomekbd.keyboard layouts)

case $current_layout in
"$default_layout")
    new_layout="$layout_two"
    ;;
"$layout_two")
    new_layout="$layout_three"
    ;;
"$layout_three")
    new_layout="$layout_four"
    ;;
*)
    new_layout="$default_layout"
    ;;
esac

gsettings set org.gnome.libgnomekbd.keyboard layouts "$new_layout"

exit 0

Generally, for nx4 keyboard layouts:

#!/bin/bash

default_layout="['...', '...', '...', '...']"    
layout_two="['...', '...', '...', '...']"    
layout_three="['...', '...', '...', '...']" 
.
.
.   
layout_n="['...', '...', '...', '...']" 

current_layout=$(gsettings get org.gnome.libgnomekbd.keyboard layouts)

case $current_layout in
"$default_layout")
    new_layout="$layout_two"
    ;;
"$layout_two")
    new_layout="$layout_three"
    ;;
.
.
.
"$layout_n-1")
    new_layout="$layout_n"
    ;;
*)
    new_layout="$default_layout"
    ;;
esac

gsettings set org.gnome.libgnomekbd.keyboard layouts "$new_layout"

exit 0

In rest all things remains valid as in this answer.

Just an observation: look out that the Ctrl+L shortcut will not work with some keyboard layouts (like Arabic keyboard layout for example). So, you must pay attention when you choose the keyboard layouts and the shortcut.

Wish you success when typing!

2
  • Hello Radu, thank you a lot for your effort :) ! It was kind of complicated, but now, finally, it seems to work :) ! Thanks a lot! Jul 1, 2013 at 19:04
  • Yes, I did, I hope I did it correctly. Thanks a lot one more time, it is really very, very helpful. Jul 1, 2013 at 19:39
0

It is true that you can only have 4 keyboard layouts installed by default. This limitation does not come from Ubuntu, but from Xorg.

While a scripted approach to make multiple sets of 4 keyboard layouts available should work, IMHO it is cumbersome to use and vulnerable to breakage in the future.

You can, however, have as many input methods as you need, assuming the input method exists for the language you need. One other point is not to confuse language support in general with the keyboard layout.

My recommendation is to use the input editor ibus for as many languages as possible; and then to use a keyboard layout that works well with the other languages.

Ibus

Ibus is the standard input method for Ubuntu. To enable it, use Language Support in System Settings.

Language Support options: input method

For the fullest range of input methods, you also need to install ibus-m17n Install ibus-m17n

Set Ibus Preferences and Input Methods

After logging out and back in, you will see the ibus indicator (a little keyboard, similar to the keyboard layouts indicator. Use the drop-down menu to open the Preferences dialog. You can also start the preferences dialog from the command line with ibus-setup.

As an aside, on the General tab, it's a good idea to change Show language panel to When active or Always. There is a bug or conflict somewhere that keeps the default option of Embedded in Menu from working. The language panel provides additional functionality for the various input methods.

enter image description here

Then choose the Input Method tab. Choose Customize active input methods. Please note that installing the ibus-m17n package or language support for a language does not automatically set up an input method. You still need to do this separately.

enter image description here

Use the Select an input method button to access the sub-menus for a long list of languages.

enter image description here

After choosing the one you want, the text will change to that input method. Click Add and the Close.

enter image description here

Keyboard layouts for the remaining languages

Most languages that use the Roman alphabet with diacritics do not necessarily need a specific keyboard layout. If after setting up input methods, you only have 3 or 4 left, by all means use the specific keyboard layouts.

But in most cases, you can insert whatever characters with diacritics you need by using the English international keyboard with dead keys or by enabling the compose key in Keyboard layout options.

How you input the characters is completely separate from how programs such as LibreOffice provide language support and spell checking.

4
  • Thanks a lot for your effertos, but unfortunately, I simply don't understand it. Suddenly the Ibus was next to where the language indication is, and I used for Chinese. But it not always worked, and sometimes it worked for other languages, which it should not work with, like English or German for instance. And I could not adjust it to some other language - I just wanted and needed it for the Chinese writing. So, now, I made it disappear, for it is of no use to me. I tried and tried and tried everything, but it has no sense to me, I give up with this Ibus. Jul 1, 2013 at 21:12
  • Well, you said I could insert whatever characters with diacritics I would need by using the English international keyboard - you're right, but this way I cannot really "write" the way I am used to. I always would have to insert manually some special signs and letters. I'm used to normal and fluent, that's touch typing. Otherwise it would have no sense with work. So, actually, back when I used Windows systems, I just elegantly chose always what language/keyboard layout I want - by mouse or shortcut - and just use it. Jul 1, 2013 at 21:14
  • I had installed some 14 or 15 languages w/ keyboard layouts. So, when writing a special language, I normally type and not always search for letters and characters. Now, this Ibus, I tried everything possible to get along, but it does not work. I cannot explain it more detailed, sorry. So, now, I have the script solution from above - maybe not optimal, and Chinese iis not working with it, but it's better than nothing. Jul 1, 2013 at 21:14
  • Thanks for you comment. I'm more than happy to improve this answer or answer a new question you might ask to help you with Ibus and input methods. But either a comment or new question would need more detail about the trouble you are having. I still think Ibus is a better long-term solution for you, but if the scripted method is working for you, by all means use it. All that matters is that you are able to do your work. ;)
    – chaskes
    Jul 2, 2013 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .