Keyboard layout reverts at every boot

10,351

Solution 1

First I entered this command at terminal to get my current keyboard layout that I set after every boot

setxkbmap -query

result:

rules:      evdev
model:      pc105
layout:     tr

I created a script that includes this line setxkbmap <layout>, in my case setxkbmap tr. I added this script to startup programs. This solved my problem.

Solution 2

I also have the same problem. I did a lot of research, but I have not found a solution for me. Instead, for many people, this was the solution:

  1. Open Terminal
  2. Type sudo vim /etc/default/keyboard
  3. The values ​​within the file should be as follows:

    XKBMODEL="pc105"
    XKBLAYOUT="it"
    XKBVARIANT=""
    XKBOPTIONS=""
    
  4. XKBLAYOUT is the code of your keyboard layout. Type man xkeyboard-config for shows the codes for keyboard model and layout.

  5. exit

Reboot and check. I hope this is the right solution for you too ;)

Solution 3

This (the second, not the first) solution definitely works. I had the same problem with the US layout I wanted to use and kept having to remove and readd each time I logged into Ubuntu 13.04. It kept reverting back to the UK Keyboard layout, despite having run:

dpkg-reconfigure keyboard-configuration

(EVEN WHEN THE LANGUAGE ICON ON THE TOP RIGHT OF THE SCREEN ACTUALLY SAYS 'en US') so this is definitely a serious bug as even changing keyboard layouts by clicking on them is completely unresponsive! Hope there will be some kind of fix for this soon.

Anyway, I found that, in fact, simply typing the command:

setxkbmap

into the 'Startup Applications' command tab solves the problem of Ubuntu forgetting the keyboard layout settings upon each boot.

HOWEVER: I did discover something else: If you are also running xmodmap in startup, then it will be OVERWRITTEN by the setxkbmap command. The setxkbmap command thus overrides the xmodmap commands at startup. (I found this out because I had finally succeeded in getting Ubuntu to remember my keybinding of Scroll Lock (which I use for my backlit keyboard) by means of running an .Xmodmap file including the modification (in my case:

add mod3 = Scroll_Lock

Would be nice if anyone has any ideas on how to be able to run both on startup, at least until there is a permanent fix for the very very common, obvious and serious language layout problem in Ubuntu (i.e. Ubuntu forgetting keyboard layout settings after every boot).

Share:
10,351

Related videos on Youtube

serdar
Author by

serdar

Updated on September 18, 2022

Comments

  • serdar
    serdar almost 2 years

    I am using 12.10 with Gnome 3. I changed LightDM to GDM. When I boot up keyboard layout changes to default US layout. When I add another layout to end of list at Region settings my selected layout becomes active. What should I do ?

  • serdar
    serdar about 11 years
    It didnt solve my problem.
  • A.B.
    A.B. over 8 years
    Why "Login with root su" and after that sudo ... and why reboot?
  • akajack
    akajack over 8 years
    Yes , sudo can be avoided . I had read that it was enough to logout and then login , but for me it worked only after the restart.