I installed GDM today (the GNOME Display Manager/Login Screen) but it doesn't respect my keyboard layout (es).
I have it set to spanish in the xorg.conf.d/10-keyboard.conf file, the /etc/locale.conf and /etc/vconsole.conf yet GDM uses the US keyboard layout.
I tried searching on this forum but there was no other thread about this. I'm on Artix Runit, with no pending updates. This happened both in my hardware machine and a Virtualbox VM.
Try using
LANG=<your locale>
export LANG
in the beginning of the GDM starting script. There is quite a long thread in Russian subforum regarding sddm under openrc with similar issue and we finally figured out how to fix that.
The problem is, your locale settings are initialized after you log in, thus when your DM starts the locale could be not initialized yet. The above solution fixes that.
EDIT: well, this solution fixes the UI language, but it is not guaranteed that it'll fix the keyboard layout. But it is still worth trying.
EDIT2: also, try renaming
/etc/X11/xorg.conf.d/10-keyboard.conf to
00-keyboard.conf
In systemd, vconsole.conf (https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration#Persistent_configuration) is used to set keyboard layout in tty, as I use 66 I'm not sure if runit is customized to read it specifically. 66 does not use that file, and instead uses
boot@system configuration.
/etc/vconsole.conf definitely doesn't have anything to do with X.Org in Artix.
Have you read Keyboard layout (https://wiki.archlinux.org/title/GDM#Keyboard_layout) and Using X configuration files (https://wiki.archlinux.org/title/Xorg/Keyboard_configuration#Using_X_configuration_files)? If so, what's the contents of your /etc/X11/xorg.conf.d/10-keyboard.conf?
I tried setting this up and it didn't work. Calling setxkbmap didn't do the trick either. :(
I've read and applied both (except for the systemd-specific commands), without anything changing.
Unfortunately, my testing seems to agree with this. GDM seems to not respect X.Org keyboard settings, contrary to that article.
@Dudemanguy suggested to me that this is likely because of GDM running in XWayland instead of X.Org. But uncommenting the line
WaylandEnable=false
in /etc/gdm/custom.conf results in GDM being unable to start, with the errors
xf86OpenConsole: VT_ACTIVATE failed: Operation not permitted
xf86OpenConsole: Switching VT failed
in Xorg.0.log.
A bug on RedHat's bugzilla (https://bugzilla.redhat.com/show_bug.cgi?id=1335511#c3) seems to suggest this is due to X.Org being run as non-root (this is done by GDM).
Also see this post on freebsd.org (https://forums.freebsd.org/threads/how-to-change-the-gdm-greeter-keyboard-layout.62548/#post-445893).
The solution from that article didn't work as well, since XWayland simply ignores all X.Org-related settings.
I suggest using an alternative like lightdm or sddm, if you really need a DM, or simply using a "Autostart X at login" no-DM setup (https://wiki.archlinux.org/title/Xinit#Autostart_X_at_login) otherwise.