mirror of
https://github.com/classy-giraffe/easy-arch.git
synced 2025-11-17 19:40:55 +00:00
fix locale selector, clear screen after listing keymaps/locales
fix another var typo and clear the screen after the user searches for locales/keymaps with / (since less floods the screen)
This commit is contained in:
parent
0a379f40f1
commit
93f2caeb3b
1 changed files with 5 additions and 2 deletions
|
|
@ -185,10 +185,12 @@ hostname_selector () {
|
||||||
# Setting up the locale (function).
|
# Setting up the locale (function).
|
||||||
locale_selector () {
|
locale_selector () {
|
||||||
read -r -p "Please insert the locale you use (format: xx_XX. Enter empty to use en_US, or type a "/" to search avaliable locales): " locale
|
read -r -p "Please insert the locale you use (format: xx_XX. Enter empty to use en_US, or type a "/" to search avaliable locales): " locale
|
||||||
case $kblayout in
|
case $locale in
|
||||||
'') print "en_US will be used as default locale."
|
'') print "en_US will be used as default locale."
|
||||||
locale="en_US.UTF-8";;
|
locale="en_US.UTF-8";;
|
||||||
'/') sed -E '/^# +|^#$/d;s/^#| *$//g;s/ .*/ (Charset:&)/' /etc/locale.gen | less -M;;
|
'/') sed -E '/^# +|^#$/d;s/^#| *$//g;s/ .*/ (Charset:&)/' /etc/locale.gen | less -M
|
||||||
|
clear
|
||||||
|
locale_selector;;
|
||||||
*) if ! grep -Fxq $locale /etc/locale.gen; then
|
*) if ! grep -Fxq $locale /etc/locale.gen; then
|
||||||
print "The specified locale doesn't exist or isn't supported."
|
print "The specified locale doesn't exist or isn't supported."
|
||||||
locale_selector
|
locale_selector
|
||||||
|
|
@ -204,6 +206,7 @@ keyboard_selector () {
|
||||||
'') print "US keyboard layout will be used by default."
|
'') print "US keyboard layout will be used by default."
|
||||||
kblayout="us";;
|
kblayout="us";;
|
||||||
'/') localectl list-keymaps
|
'/') localectl list-keymaps
|
||||||
|
clear
|
||||||
keyboard_selector;;
|
keyboard_selector;;
|
||||||
*) if ! $(localectl list-keymaps | grep -Fxq $kblayout); then
|
*) if ! $(localectl list-keymaps | grep -Fxq $kblayout); then
|
||||||
print "The specified keymap doesn't exist."
|
print "The specified keymap doesn't exist."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue