Summary
Right now, we can override gnome, kde's built-in layout. However, the buildDefaultGroup still only considers xprop value.
Under wayland, xprop value is commonly not set at all.
Also, locale1 provides an alternative way of getting the layout, which can be used as a good fallback, especially for the first run after installation.