How to change keyboard on Acer Aspire One

I bought this wonderful piece of hardware last week from UK Amazon for amazing 180 pounds and I am still really surprised by this netbook. It is light (just 1 kg), with nice and comfortable keyboard (for its size) and I haven't noticed any non working or dodgy parts in there. As I am from the Czech republic and I write some blogs in that language, the first thing I need was switching the keyboard and language to Czech. But as I have some experiences with Gentoo only and not with the Linux Linpus (which is some clone of Red Hat Fedora) I had to dig for the advice on the Internet. But since I have found some dirty workarounds and hacks on the Acer Aspire One forums only I decided to investigate the issue by myself. And after all, I am bringing the easy and clean solution so you can now enjoy this lovely laptop with your native language.

Honestly it is pretty easy and straightforward, the only thing you need is edit one(!) configuration file and reboot. The file is /etc/sysconfig/i18n and it contains the list of the languages you can choose from. There are two options in that file we are interested in. LANG specifies the language of the environment, so all your dialogs and windows will be using language you set here. The other option LANGUAGE specifies the keyboard layout. Here is the step by step how to change the file content.

1. Press Alt + F2
2. In the dialog type "sudo xterm" and hit the enter - linux terminal will appear
3. type "vim /etc/sysconfig/i18n" and hit the enter - the file will be opened in the VI editor
4. Change two variables (LANG and LANGUAGE) to reflect your needs. Use the code from the SUPPORTED attribute below, ie. for  French type fr_FR.UTF-8. For those who dont know how to work with VI here are few tips: Press "i" for editing the content, press "Escape" for leaving the edit mode, type ":wq" for save the content and quit the editor, if you want to quit without changing the file type ":w!".
5. Reboot the computer - either from terminal by typing "reboot" or from taskbar throught the icon on the bottom right.

It is possible to have a different language for dialogs and menus and for keyboard layout so for example my configuration looks like LANG=en_US.UTF-8 and LANGUAGE=cs_CZ.UTF-8 which means, that all the dialogs and menus are in English and I can switch my keyboard from EN, to GB and CS. There is one more settings I changed, since I don't like that when I boot up the computer, the keyboard language is set to Czech by default and even if I change it to English every new opened application will have the Czech lagunage as the default too. I would like to us GB English by the default language and CZ and US English would be just as secondary option. For fixing this, you have to edit one more file which is located in /usr/bin/xkb_plugin_set_xorg.sh.

In there you have to change the order of languages for your language code. In my case I changed the following line from:

cs_CZ.UTF-8):sed -e '/XkbLayout/c\        Option      "XkbLayout" "cz,gb,us"'    /etc/X11/xorg.conf > /etc/X11/xorg.conf.bak;;

To:

cs_CZ.UTF-8):sed -e '/XkbLayout/c\        Option      "XkbLayout" "gb,cz,us"'    /etc/X11/xorg.conf > /etc/X11/xorg.conf.bak;;

Mind the swapped "cz,gb,us" to "gb,cz,us". And here is the step by step:

1. Press Alt + F22. In the dialog type "sudo xterm" and hit the enter - linux terminal will appear3. type "vim /usr/bin/xkb_plugin_set_xorg.sh" and hit the enter - the file will be opened in the VI editor4. Change the line with your language code to fit your needs.5. Reboot the computer - either from terminal by typing "reboot" or from taskbar throught the icon on the bottom right.

And that's it - hope that it will help, dont hesitate to ask in discussion below if you still have issues or something doesnt work as expected.

Comments