How to set keyboard layout on login screen?

I’m using a Logitech cordless keyboard (universal usb receiver). Whenever I login, lightdm is on US keyboard layout, (when it’s supposed to be on French) which can be especially annoying when typing a password. It’s a known bug for this kind of Logitech keyboards. With some distros like UBuntu Unity & Gnome the problem is fixed. Some others like Mint and OpenSuse need to add “setxkbmap fr” in a configuration file.
As for Ubuntu MATE, I tried to add “setxkbmap fr” in the file /etc/lightdm/lightdm-gtk-greeter-ubuntu.conf, but no way.
Is there any other config file where Lightdm can be forced to use a particular keyboard layout?

Hi,

unfortunately I do not have a real answer, but I would look to push this topic up again! I have exactly the same problem (only here the keyboard should be German) and would be very happy if a solution could be provided. Other than that, I really like Ubuntu MATE and would like to thank those who donate their time to the project.

Oh, I almost forgot, I am on the current LTS version 14.04.

I’m a new user of ubuntu mate 15.10, and I have Logitech keyboard too. Today, I had some time to digging up this issue, instead of using the unity greeter, which is a bit messy xD. I finally found a way to make it works.

I modify the /usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf file that way :

[Seat:*]
greeter-session=lightdm-gtk-greeter

greeter-setup-script=/usr/bin/numlockx on
display-setup-script=setxkbmap -model pc105 -layout fr

As you can see, I used the display-setup-script parameter. In the lightdm.log, we can see it trigger earlier in the launch process, before the greeter was started. And it works !
My guess is when the greeter is started, it tries to autoconfigures the keyboard, and don’t succeed and fallback to qwerty, and if you change

3 Likes

Thank you tabasco that worked for me too!
I only had to install numlockx first:

sudo apt-get install numlockx

otherwise you get a black screen on startup…
or just remove the line with numlockx

Thanks!

Hi, I added the “keyboard layout” to the panel in the LightDM GTK+ Greeter (System->Administration->LightDM GTK+ Greeter settings) and since I did this, the keyboard layout on my login magically switched to the right one (and stayed like that)

1 Like

Tabasco,

I registered to Ubuntu MATE Community, just to say thank you.
Just to add upon your answer : if the lightdm.conf.d directory doesn’t exist, then one can “mkdir” it without any worrying and then create the 60-lightdm-gtk-greeter.conf inside of it.
I’m under Raspberry Pi 2, with Raspbian Jessie installed on it and it did the trick. Thanks Tabasco, you rule !