mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
use case to dispatch internationalisation menu functions
This commit is contained in:
parent
3d725a80fa
commit
c85396d754
21
raspi-config
21
raspi-config
@ -178,17 +178,17 @@ do_change_pass() {
|
||||
whiptail --msgbox "Password changed successfully" 20 60 1
|
||||
}
|
||||
|
||||
do_I3() { # Keyboard
|
||||
do_configure_keyboard() {
|
||||
dpkg-reconfigure keyboard-configuration &&
|
||||
printf "Reloading keymap. This may take a short while\n" &&
|
||||
invoke-rc.d keyboard-setup start
|
||||
}
|
||||
|
||||
do_I1() { # Locale
|
||||
do_change_locale() {
|
||||
dpkg-reconfigure locales
|
||||
}
|
||||
|
||||
do_I2() { # Timezone
|
||||
do_change_timezone() {
|
||||
dpkg-reconfigure tzdata
|
||||
}
|
||||
|
||||
@ -526,15 +526,20 @@ fi
|
||||
|
||||
do_internationalisation_menu() {
|
||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Internationalisation Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||
"I1 Change Locale" "Set up language and regional settings to match your location" \
|
||||
"I2 Change Timezone" "Set up timezone to match your location" \
|
||||
"I3 Change Keyboard Layout" "Set the keyboard layout to match your keyboard" \
|
||||
3>&1 1>&2 2>&3)
|
||||
"I1 Change Locale" "Set up language and regional settings to match your location" \
|
||||
"I2 Change Timezone" "Set up timezone to match your location" \
|
||||
"I3 Change Keyboard Layout" "Set the keyboard layout to match your keyboard" \
|
||||
3>&1 1>&2 2>&3)
|
||||
RET=$?
|
||||
if [ $RET -eq 1 ]; then
|
||||
return 0
|
||||
elif [ $RET -eq 0 ]; then
|
||||
"do_$(echo $FUN | head -c 2)" || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||
case "$FUN" in
|
||||
I1\ *) do_change_locale ;;
|
||||
I2\ *) do_change_timezone ;;
|
||||
I3\ *) do_configure_keyboard ;;
|
||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user