arc: fix keymap automation

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-06-29 10:11:12 +02:00
parent b116610e48
commit b424d25fe1

View File

@ -140,7 +140,14 @@ if [ "${OFFLINE}" == "false" ]; then
hwclock -w > /dev/null 2>&1
fi
if [ -z "${LAYOUT}"]; then
[ -z "${KEYMAP}" ] && KEYMAP="en"
if [ -n "${KEYMAP}" ]; then
KEYMAP="$(echo ${KEYMAP} | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]' | tr -d '[:punct:]' | tr -d '[:digit:]')"
else
KEYMAP="us"
fi
fi
if ! loadkeys ${KEYMAP}; then
KEYMAP="us"
loadkeys ${KEYMAP}
fi