Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First login keyboard configuration bugfix #2746

Merged
merged 4 commits into from Apr 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 2 additions & 11 deletions packages/bsp/common/usr/lib/armbian/armbian-firstlogin
Expand Up @@ -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 ""
Expand Down Expand Up @@ -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
Expand Down