diff --git a/packages/bsp/common/usr/lib/armbian/armbian-firstlogin b/packages/bsp/common/usr/lib/armbian/armbian-firstlogin index 9fcda3dd2573..87d2e122890b 100755 --- a/packages/bsp/common/usr/lib/armbian/armbian-firstlogin +++ b/packages/bsp/common/usr/lib/armbian/armbian-firstlogin @@ -95,11 +95,10 @@ set_timezone_and_locales() TZDATA=$(echo ${RES} | cut -d"," -f1) STATE=$(echo ${RES} | cut -d"," -f2) CCODE=$(echo ${RES} | cut -d"," -f3 | xargs) - KEYBOARD="${CCODE,,}" - LOCALES=$(grep territory /usr/share/i18n/locales/* | grep "$CCODE" | cut -d ":" -f 1 | cut -d "/" -f 6 | \ + LOCALES=$(grep territory /usr/share/i18n/locales/* | grep _"$CCODE" | cut -d ":" -f 1 | cut -d "/" -f 6 | \ xargs -I{} grep {} /usr/share/i18n/SUPPORTED | grep "\.UTF-8" | cut -d " " -f 1) # UTF8 is not present everywhere so check again in case it returns empty value - [[ -z "$LOCALES" ]] && LOCALES=$(grep territory /usr/share/i18n/locales/* | grep "$CCODE" | cut -d ":" -f 1 | cut -d "/" -f 6 | \ + [[ -z "$LOCALES" ]] && LOCALES=$(grep territory /usr/share/i18n/locales/* | grep _"$CCODE" | cut -d ":" -f 1 | cut -d "/" -f 6 | \ xargs -I{} grep {} /usr/share/i18n/SUPPORTED | cut -d " " -f 1) echo -e "Detected timezone: \x1B[92m$TZDATA\x1B[0m" echo "" @@ -146,14 +145,6 @@ set_timezone_and_locales() echo "export LANG=$LOCALES" >> /home/$RealUserName/.xsessionrc echo "export LANGUAGE=$LOCALES" >> /home/$RealUserName/.xsessionrc - # adding another keyboard layout - if grep -q " ${CCODE,,} " /usr/share/X11/xkb/rules/base.lst ; then - echo -e "Adding console keyboard layout: \x1B[92m$CCODE\x1B[0m" - CCODE=$(cat /etc/default/keyboard | grep XKBLAYOUT | awk -F'"' '$0=$2')",$CCODE" - sed -i "s/XKBLAYOUT=.*/XKBLAYOUT=\"$KEYBOARD\"/" /etc/default/keyboard - setupcon -k --force - fi - fi fi fi