From b51d065170360a3c1576ff2742be24e2ea73b170 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 4 Apr 2023 23:00:00 +0200 Subject: [PATCH] Set the x11 keymap during system setup --- scripts/Arch/OS/set-keymap.service | 9 +++++++++ scripts/Arch/OS/setup.sh | 6 ++++++ 2 files changed, 15 insertions(+) create mode 100644 scripts/Arch/OS/set-keymap.service diff --git a/scripts/Arch/OS/set-keymap.service b/scripts/Arch/OS/set-keymap.service new file mode 100644 index 00000000..6bf3b9b7 --- /dev/null +++ b/scripts/Arch/OS/set-keymap.service @@ -0,0 +1,9 @@ +[Unit] +Description=Set X11 Keymap + +[Service] +PassEnvironment=ARCH_X11_KEYMAP +ExecStart=bash -c 'localectl set-x11-keymap "$ARCH_X11_KEYMAP"; poweroff' + +[Install] +WantedBy=multi-user.target diff --git a/scripts/Arch/OS/setup.sh b/scripts/Arch/OS/setup.sh index c4d39c12..b1218689 100755 --- a/scripts/Arch/OS/setup.sh +++ b/scripts/Arch/OS/setup.sh @@ -59,6 +59,12 @@ USER_DISPLAYNAME="${USER_DISPLAYNAME}" \ USER_GROUPS="${USER_GROUPS}" \ arch-chroot "$ARCH_MOUNT_ROOT" bash "$tempDir/user.sh"; +cp ./set-keymap.service "$ARCH_MOUNT_ROOT/etc/systemd/system"; +systemd-nspawn -D "$ARCH_MOUNT_ROOT" systemctl enable set-keymap; +systemd-nspawn -bD "$ARCH_MOUNT_ROOT" -E "ARCH_X11_KEYMAP=${ARCH_X11_KEYMAP}"; +systemd-nspawn -D "$ARCH_MOUNT_ROOT" systemctl disable set-keymap; +rm "$ARCH_MOUNT_ROOT/etc/systemd/system/set-keymap.service"; + arch-chroot "$ARCH_MOUNT_ROOT" rm -rf "$tempRoot"; popd > /dev/null;