Verified Commit c3ed09fa authored by Erazem Kokot's avatar Erazem Kokot
Browse files

Split off setting a keyboard layout

Move set_keyboard_layout() into a new script and run it before start_menu()
to allow user to set keyboard layout before entering wifi password.
parent aeefeada
......@@ -64,8 +64,8 @@ main() {
exit 1
fi
set_keyboard_layout
start_menu
set_keys
update_mirrors
get_connection_info
set_locale
......
#!/usr/bin/env bash
set_keyboard_layout() {
op_title="${key_op_msg}"
while (true); do
keyboard="$(dialog --nocancel --ok-button "${ok}" --menu "${keys_msg}" 18 60 10 \
"de" "German" \
"el" "Greek" \
"es" "Spanish" \
"fr" "French" \
"hu" "Hungarian" \
"it" "Italian" \
"pt-latin9" "Portugal" \
"ro" "Romanian" \
"ru" "Russian" \
"slovene" "Slovenian" \
"sv" "Swedish" \
"uk" "United Kingdom" \
"us" "United States" \
"${other}" "${other}-keymaps" 3>&1 1>&2 2>&3)"
source "${lang_file}"
if [ "${keyboard}" = "${other}" ]; then
keyboard="$(dialog --ok-button "${ok}" --cancel-button "${cancel}" --menu "${keys_msg}" 19 60 10 ${key_maps} 3>&1 1>&2 2>&3)"
if [ "$?" -eq 0 ]; then
break
fi
else
break
fi
done
localectl set-keymap "${keyboard}"
loadkeys "${keyboard}"
log "Set keymap to: ${keyboard}"
}
#!/usr/bin/env bash
# Copyright (C) 2017 Dylan Schacht
set_keys() {
op_title="${key_op_msg}"
while (true); do
keyboard="$(dialog --nocancel --ok-button "${ok}" --menu "${keys_msg}" 18 60 10 \
"de" "German" \
"el" "Greek" \
"es" "Spanish" \
"fr" "French" \
"hu" "Hungarian" \
"it" "Italian" \
"pt-latin9" "Portugal" \
"ro" "Romanian" \
"ru" "Russian" \
"slovene" "Slovenian" \
"sv" "Swedish" \
"uk" "United Kingdom" \
"us" "United States" \
"${other}" "${other}-keymaps" 3>&1 1>&2 2>&3)"
source "${lang_file}"
if [ "${keyboard}" = "${other}" ]; then
keyboard="$(dialog --ok-button "${ok}" --cancel-button "${cancel}" --menu "${keys_msg}" 19 60 10 ${key_maps} 3>&1 1>&2 2>&3)"
if [ "$?" -eq 0 ]; then
break
fi
else
break
fi
done
localectl set-keymap "${keyboard}"
loadkeys "${keyboard}"
log "Set keymap to: ${keyboard}"
}
set_locale() {
op_title="${locale_op_msg}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment