How to set keyboard layout in the terminal?

I’m trying GNOME GUI apps in a Linux distro in Windows 11 + WSL2. The GUI apps open normally, but not the GNOME Settings. While the terminal’s keyboard layout is already correctly set, I haven’t found how to set it for the GNOME apps.

I tried the following without success:

  • gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'br+abnt2')]"
  • setxkbmap -model abnt2 -layout br -variant abnt2
  • ibus-setup doesn’t seem to keep the keyboard layouts I set in there

Any idea?

Ok, so it seems to be an upstream issue. That is Microsoft, in this case. Tracked in Keyboard layout messed up for KBD_PORTUGUESE_BRAZILIAN_ABNT2. · Issue #27 · microsoft/wslg · GitHub

Workaround: export WAYLAND_DISPLAY="wayland-1"

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.