Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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"
EndSection
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
add comment

4 Answers

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

share|improve this answer
add comment

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
add comment

I haven't tried this but this is the basic approach i will try. i.e: modifying the xorg.conf files. https://wiki.archlinux.org/index.php/Xorg#Setting_Keyboard_Layout_With_Hot-Plugging Though, ubuntu seems to use a different xorg folder layout. and you may have trouble finding the right file.

share|improve this answer
    
Modifying xconf.org 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... –  Anand Jeyahar 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
add comment
up vote 0 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"
EndSection
share|improve this answer
add comment

Your Answer

 
discard

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.