Set the x11 keymap during system setup

This commit is contained in:
Manuel Thalmann 2023-04-04 23:00:00 +02:00
parent 23ec9a15c1
commit b51d065170
2 changed files with 15 additions and 0 deletions

View file

@ -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

View file

@ -59,6 +59,12 @@ USER_DISPLAYNAME="${USER_DISPLAYNAME}" \
USER_GROUPS="${USER_GROUPS}" \ USER_GROUPS="${USER_GROUPS}" \
arch-chroot "$ARCH_MOUNT_ROOT" bash "$tempDir/user.sh"; 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"; arch-chroot "$ARCH_MOUNT_ROOT" rm -rf "$tempRoot";
popd > /dev/null; popd > /dev/null;