XFCE: Keyboard layout management for different languages

Post your tutorials and howtos here.
User avatar
ilu
Posts: 2524
Joined: 09 Oct 2013 12:45

XFCE: Keyboard layout management for different languages

Postby ilu » 24 Aug 2015 21:15

I tried to figure out different ways to use more than one keyboard layout and to switch between them on the fly. The best way was this (credit goes mostly to chainy from askubuntu.com):

1. Go to Xfce Settings Manager => Keyboard => Layout. Uncheck "Use System Defaults". Install the keyboards you want. Save, logout and login (this might be superfluous, i don't know), go there again and check "Use System Defaults".
2. Open the terminal.

Code: Select all

sudo mousepad /etc/default/keyboard
For example, if you want to be able to switch between English, German and Russian phonetic (make sure you have installed the phonetic variant in step 1), make the following alterations (leave everything else as it is):

Code: Select all

XKBLAYOUT="gb,de,ru"
XKBVARIANT=",,phonetic"
XKBOPTIONS="grp:alt_caps_toggle"
No spaces between the languages! The shortcut for switching between the languages is in this case Alt + Caps Lock.

3. Save the changes and reboot.

4. If you don't see a little flag on your taskbar, right-click it, choose Bar => Add new elements and add the Keyboard plugin.

With the terminal command cat /usr/share/X11/xkb/rules/xorg.lst you can see the language codes, the types of variants, and also the shortcuts that can be used.
It also works inside wine. Only remaining problem: The key for > on the german keyboard is gone and now shows the russian behaviour |¦ :?: .

To get rid of that problem and to get better phonetic equivalents for me, inspired by http://blechtrottel.net/ruphonde.html , I had a look (don't change anything) at

Code: Select all

 mousepad /usr/share/X11/xkb/symbols/de
and installed de.ru instead of ru.phonetic and changed /etc/default/keyboard to

Code: Select all

XKBLAYOUT="gb,de,de"
XKBVARIANT=",,ru"
XKBOPTIONS="grp:alt_caps_toggle"
In the options (right click on the flag in the taskbar => Properties) you can change keyboard per application or globally. I'm still experimenting.

Now all keys work as they should but the taskbar icon changes from <german flag> to <german flag> ... super. Right click on the flag => Properties => Show as text produces <de> and <de.> - can you see the difference? I can if I squint ... :P

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 2 guests