This one "works on my machine": I put it into my /usr/etc/X11/xdm/ and, after rebooting, my keyboard settings still survive. It must be noted that, if XKBLAYOUT is set, /etc/vconsole.config is now consistently rewritten twice at every boot (first "localectl set-keymap ..." mangles it just as it did before, and then "localectl set-x11-keymap ..." restores it to what it was). Also... the script's logic is now even more unnecessarily convoluted now than it was before :)