From 9a9c5eb490dd139076729e8145d14929147bc267 Mon Sep 17 00:00:00 2001 From: Floris Bos Date: Thu, 25 Nov 2021 01:34:13 +0100 Subject: [PATCH] cloud-init: set keyboard through localectl Set keyboard through systemd's localectl instead of writing to Debian specific /etc/default/keyboard directly, as this also works for other Linux distributions. On Debian/Ubuntu one does still need to run a distro specific command to have the keyboard change be effective without reboot first (setupcon). --- OptionsPopup.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/OptionsPopup.qml b/OptionsPopup.qml index ec018c2..781568e 100644 --- a/OptionsPopup.qml +++ b/OptionsPopup.qml @@ -689,9 +689,8 @@ Popup { addFirstRun("dpkg-reconfigure -f noninteractive keyboard-configuration") addCloudInit("timezone: "+fieldTimezone.editText) - addCloudInitWriteFile("/etc/default/keyboard", kbdconfig, '0644') - addCloudInitRun("dpkg-reconfigure -f noninteractive keyboard-configuration || true") - addCloudInitRun("setupcon -k -v --force || true") + addCloudInitRun("localectl set-x11-keymap \""+fieldKeyboardLayout.editText+"\" pc105") + addCloudInitRun("setupcon -k --force || true") } if (firstrun.length) {