Unable to set UK keyboard layout on RPI400

Hi everyone, I’m having a hard time with “Manjaro Settings Manager” in setting my “Keyboard Settings”. I know this should be a trivial thing, but my “RaspberryPi 400” with UK keyboard keeps acting as US no matter what I do:

localectl status
System Locale: LANG=en_GB.UTF-8
VC Keymap: uk
X11 Layout: gb
X11 Model: pc104

(not relevant) After the last update to my i3 version bricked my installation I had to move to sway, but for some reason localectl shows "X11 layout and model.

I’ve tried other models like pc86 and pc98 (the RPI400 UK layout has 79 keys). I even tried different variants but nothings seems to work.

I had a similar bug when I was using i3 with X11, where my layout would be changed to US after every reboot, but changing the settings in Manjaro Settings Manager would fix have an effect, unlike my current situation.

I got the aarch64 sway edition and have everything up to date:
sudo pacman -Syu
:: Synchronising package databases…
core is up to date
extra is up to date
community is up to date
:: Starting full system upgrade…
there is nothing to do

Please let me know what other info I should share in order to help the troubleshooting.

:bangbang: Tip: :bangbang:

When posting terminal output, copy the output and paste it here, wrapped in three (3) backticks, before AND after the pasted text. Like this:

```
pasted text
```

Or three (3) tilde signs, like this:

~~~
pasted text
~~~

This will just cause it to be rendered like this:

Sed
sollicitudin dolor
eget nisl elit id
condimentum
arcu erat varius
cursus sem quis eros.

Instead of like this:

Sed sollicitudin dolor eget nisl elit id condimentum arcu erat varius cursus sem quis eros.

Alternatively, paste the text you wish to format as terminal output, select all pasted text, and click the </> button on the taskbar. This will indent the whole pasted section with one TAB, causing it to render the same way as described above.

Thereby increasing legibility thus making it easier for those trying to provide assistance.

For more information, please see:


:bangbang::bangbang: Additionally

If your language isn’t English, please prepend any and all terminal commands with LC_ALL=C. For example:

LC_ALL=C bluetoothctl

This will just cause the terminal output to be in English, making it easier to understand and debug.

Whenever I try to write “#” I get a "".
Whenever I try to write “~” I get a “|”.
Whenever I try to write “the pound symbol” I get a “#”.
Whenever I try to write “|” I get a “>”.

Hi @capcom, and welcome!

Have you checked here:

https://wiki.archlinux.org/title/Locale#Setting_the_locale

Hello @Mirdarthos , thanks for the welcome and for the link. I ran a few commands and checked a few files:

locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=

cat /etc/locale.conf
LANG=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_MONETARY=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_NUMERIC=en_GB.UTF-8
LC_PAPER=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_TIME=en_GB.UTF-8

grep en_GB /usr/share/X11/locale/locale.dir
iso8859-1/XLC_LOCALE                    en_GB.ISO8859-1
iso8859-15/XLC_LOCALE                   en_GB.ISO8859-15
en_US.UTF-8/XLC_LOCALE                  en_GB.UTF-8
iso8859-1/XLC_LOCALE:                   en_GB.ISO8859-1
iso8859-15/XLC_LOCALE:                  en_GB.ISO8859-15
en_US.UTF-8/XLC_LOCALE:                 en_GB.UTF-8

grep en_GB /usr/share/X11/locale/compose.dir
iso8859-1/Compose               en_GB.ISO8859-1
iso8859-15/Compose              en_GB.ISO8859-15
en_US.UTF-8/Compose             en_GB.UTF-8
iso8859-1/Compose:              en_GB.ISO8859-1
iso8859-15/Compose:             en_GB.ISO8859-15
en_US.UTF-8/Compose:            en_GB.UTF-8

See here:

Also see:

https://wiki.archlinux.org/title/Xorg/Keyboard_configuration#Setting_keyboard_layout

I only have and use a desktop, so I do not have a clue whether it would be the same on the ARM devices. (The RPI is an ARM device, so yeah…)

Edit:

You can set more in /etc/default/keyboard, AFAIK. Mine, for example:

$ cat /etc/default/keyboard
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="za"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

Value of XKBLAYOUT is the layout of keyboard. Change it to another possible value and reboot the machine to take effects.

I’m beginning to thinks this has something to do with “Manjaro Settings Manager”. There is a little testing area there where you can type things. Although I have English (UK) “Default” set and applied, the “#” key still prints "".

I don’t know. I’ve never used Manjaro settings manager. Simply because I like the CLI.

Thanks again @Mirdarthos for the reply. I found out something curious. The console is ok, so the problem is only on wayland.

$ cat /etc/default/keyboard
# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="gb"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

$ grep -v "^#" /etc/locale.gen
en_GB.UTF-8 UTF-8


$ cat /etc/vconsole.conf
KEYMAP=uk
XKBLAYOUT=gb
XKBMODEL=pc105

I’ve tried to use " localectl set-keymap uk" but the issue on wayland persists

Well, I’ve seen multiple problems with Wayland…so I’m not sure what to do except point you here:

https://unix.stackexchange.com/questions/689657/trying-to-set-keyboard-layout-to-us-intl-on-wayland/707792#707792

It may or may not do something, good or bad, I don’t know…

Edit:

Also see:

And:

https://www.reddit.com/r/linuxquestions/comments/tby98j/change_keyboard_layout_in_wayland/

And:

https://askubuntu.com/questions/1437227/custom-layout-and-variant-keyboard-in-wayland/1438326#1438326

use localectl to set the layout

sudo localectl set-keymap uk

This will write the corresponding files correctly. For changes you will have to restart your system - perhaps logging out is enough.

I just did with my pbp with us layout and # moved from shift3 to the other side of the keyboard labelled |.

But you are using Wayland - then it is sway - right? Then you would have to look at sway configuration - no?

1 Like

<3 <3 <3

/etc/sway/inputs/default-keyboard had ‘xkb_layout “us”’. Changing to “gb” fixed the issue.

1 Like

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