Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So Ubuntu has moved to HAL, and commented out the keyboard section in xorg.conf. So how do I configure keyboard layouts now?

UPD: I'm using XMonad as my window manager, so I need a way to configure layouts that works outside GNOME too.

UPD: Editing xorg.conf does not work, here's the relevant section from mine:

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout" "us,ru"
    Option         "XkbOptions" "grp:ctrl_shift_toggle, caps:ctrl_modifier, compose:sclk, terminate:ctrl_alt_bksp, grp_led:scroll"
share|improve this question
Doesn't this work: Open the Dash and search for 'layout', open the 'Keyboard Layout' ? – hakermania May 6 '12 at 12:38

This is how I chose to configure my keyboard in XMonad. I tend to shy away from editing the X11 files in XMonad since the Haskell language is so powerful.

In your xmonad.hs file (should be in ~/.xmonad/) I used these two lines to handle keyboard switching via hotkeys in the additionalKeys section.

-- keyboard layout --
      , ((mod1Mask .|. shiftMask, xK_d), spawn "setxkbmap -layout dvorak")
      , ((mod1Mask .|. shiftMask, xK_u), spawn "setxkbmap -layout us")
share|improve this answer

setxkbmap in your .xinitrc? More here, including example of setting French layout.

share|improve this answer
up vote 1 down vote accepted

This ended up working:

Section "InputClass"
    Identifier      "KeyboardLayout"
    Driver          "evdev"
    MatchIsKeyboard "yes"
    Option          "XkbLayout" "us,ru"
    Option          "XkbOptions" "grp:ctrl_shift_toggle,caps:ctrl_modifier,compose:sclk,terminate:ctrl_alt_bksp,grp_led:scroll"
share|improve this answer

I haven't tried this but this is the basic approach i will try. i.e: modifying the xorg.conf files. Though, ubuntu seems to use a different xorg folder layout. and you may have trouble finding the right file.

share|improve this answer
Modifying changes nothing. – Alexei Averchenko May 7 '12 at 3:08
I wanted to add MatchIsKeyboard "on" but made a mistake and wrote WatchIsKeyboard and now the whole system won't boot up!!!! What the hell, how can Ubuntu devs release a system that can be toasted by a single typo? – Alexei Averchenko May 7 '12 at 3:54
Won't boot?? do you get the bootloader menu? If so, you should be able to drop in to rescue mode and fix the typo... – Software Mechanic May 7 '12 at 4:43
Rescue mode won't boot up either :( – Alexei Averchenko May 7 '12 at 5:29
Ok, I fixed the system not booting up (a very hairy trivial issue it was), but your solution still doesn't work: X doesn't recognize MatchIsKeyboard, and without it keyboard options have no effect. – Alexei Averchenko May 7 '12 at 5:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.