So I have an IBM Thinkpad X31, running natty and xmonad as the window manager. The keyboard is Italian. I wish to use an American English keyboard mapping, all the time. How do I do this?
Here is one way to connect XMonad and multiple keyboard layouts.
Step 1. Create a script that will switch between your layouts. For the sake of example, let's say we will support English (US), Italian and French.
Test this script - run it and see if the keyboard layout cycles between the layouts. If it does, proceed to the next step.
Step 2. Customize XMonad settings to support custom key binding that will switch the layout.
In your home directory, create a directory named ".xmonad" (if it does not exist).
Now, restart XMonad by pressing Mod+q. Your layout switcher should be fully functional.
To change your keyboard mapping to American English, you run the command
You might already have a startup file to launch and configure things at login.
Add the following line to use several keyboard layouts:
For windows to remember their layout:
If you use xmobar and want to show the current layout, add this to your
That was for all people googling for multiple keyboard layouts and finding this thread. If you want only one keyboard layout, add this to your startup script: