Linux – Change lightdm keyboard layout US to Portuguese Arch Linux

arch linuxlightdmlocale

I'm installing Arch Linux, but I have a problem with the installation of my display manager, lightdm.

When I install and enable lightdm, I think the keyboard layout changes from Portuguese to US.

Changing the keymapping with:

# localectl set-locale LANG=pt_PT.UTF-8 

only works until lightdm launches, then the keymapping reverts to US. The same occurs when I try to change it permanently by changing to KEYMAP=br-latin1 with:

# sudo nano /etc/vconsole.conf

Best Answer

Ok, I have found the answer to my question, I believe that it can be applied to other languages than Portuguese.

The LightDM keyboard layout to Portuguese is done with this command:

localectl set-x11-keymap pt

I did this as root, and I think it is the right way, but you can do it has a normal user too, I believe.

I've found this on Fedora forum.

For set-x11-keymap to work, first, we need to install package libxkbcommon, without that will give you an error message.

I've found it on ArchLinux forum.

UPDATE

I asked this question also in Arch Linux forum and this answer, solves the problem too, adding to the file /etc/X11/xorg.conf.d/20-keyboard.conf, these configs:

Section "InputClass"
    Identifier "system-keyboard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "pt"
    Option "XkbModel" "pc105"
EndSection

and reboot...

Related Question