1

During installation I just want to run a set of commands and not do all the settings with raspi-config.

How can I set the keyboard layout just with the command line without any further interaction / UIs?

3
  • Does this answer your question? Simple Keyboard Configuration Commented Dec 4, 2021 at 10:11
  • If you use ctrl-shift-x in raspberry pi imager, the keyboard setting can be set there - best way to do it "during installation" Commented Dec 5, 2021 at 9:56
  • @Dougie I also saw that post but wanted something without any interaction / clicking / typing Commented Dec 5, 2021 at 15:58

2 Answers 2

2

I figured out this sed command line to set e.g. german keyboard layout:

sudo sed -i -e 's/XKBLAYOUT="[a-z][a-z]"/XKBLAYOUT="de"/' /etc/default/keyboard 
1

It's possible to do this via raspi-config nonint do_configure_keyboard. E.g. raspi-config nonint do_configure_keyboard us sets the US keyboard layout.

Reference: Where can I learn about the raspi-config noint parameters?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.