Adding language layouts to Xfce (method 2)
With Ubuntu 8.10, the previous method doesn't work. This is a way to manually set the keyboard layouts:
Create a file in /usr/bin/
vim /usr/bin/fixkeyboard
Add following lines in this file. I am using US and PK layouts in this example, please change it to the keyboard layouts you want to use. Also note that this example sets xkb option to change groups when both alt keys are pressed together.
#!/bin/bash
setxkbmap -option grp:switch,grp:alts_toggle us,ru
Save the file and exit.
Make it executable:
chmod a+x /usr/bin/fixkeyboard
From the XFce menu, go to Applications > Settings > Autostarted Applications and click the Add button. In the Name feild type fixkeyboard and in the Command feild type /usr/bin/fixkeyboard press OK and then Close.
You are done. Now whenever you log on to your XFCE session you will be able to switch keyboard layouts by pressing both Alt keys together. If you don’t like the both Alt keys combination then you can try other group switch combinations. Replace alts_toggle in fixkeyboard file with one of the following options:
alt_shift_toggle
ctrl_shift_toggle
ctrls_toggle
Country flags for XFCE xkb plugin are located in /usr/share/xfce4/xkb/flags/. If your country’s flag is missing you can add it there, the file should be in png format and 60 x 40 pixels.