Skip to content

Commit e302bc2

Browse files
committed
refactoring
1 parent e44c10d commit e302bc2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

usr/libexec/helper-scripts/set-keyboard-layout.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,24 @@ is_layout_data_valid() {
4848
local valid_list_cmd check_str check_lines check_list check_item \
4949
valid_output valid_item_list valid_item is_item_valid
5050

51-
[[ -v localctl_available ]] || localctl_available=""
51+
[[ -v localectl_available ]] || localectl_available=""
5252

53-
if [ "$localctl_available" = "false" ]; then
53+
if [ "$localectl_available" = "false" ]; then
5454
return 0
5555
fi
5656

5757
## localectl cannot be run within a chroot to get lists of valid values.
5858
## Assume data is correct if it passed the previous sanity checks.
5959
if ischroot --default-false; then
60-
localctl_available=false
60+
localectl_available=false
6161
return 0
6262
fi
6363

6464
if localectl >/dev/null; then
65-
localctl_available=true
65+
localectl_available=true
6666
else
6767
printf '%s\n' "$0: INFO: Failed to run 'localectl'. Is dbus running?"
68-
localctl_available=false
68+
localectl_available=false
6969
return 0
7070
fi
7171

@@ -587,7 +587,7 @@ set_console_keymap() {
587587
kb_reload_root() {
588588
local loginctl_users user_list uid_list user_name uid wl_sock wl_pid wl_comm account_name
589589

590-
if [ "$localctl_available" = "false" ]; then
590+
if [ "$localectl_available" = "false" ]; then
591591
printf '%s\n' "$0: WARNING: Minor issue. 'localectl' unavailable. Reboot may be required to change keyboard layout."
592592
return 0
593593
fi
@@ -824,7 +824,7 @@ interactive_ui() {
824824
variant_key_str
825825

826826
## Test run.
827-
## sets: localctl_available
827+
## sets: localectl_available
828828
is_layout_data_valid us localectl list-x11-keymap-layouts
829829

830830
skl_interactive='true'
@@ -859,7 +859,7 @@ Type 'exit' to quit without changing keyboard layout settings.
859859
## contain spaces or capital letters.
860860
layout_str="$(tr -d ' ' <<< "${layout_str,,}")"
861861
if [ "${layout_str}" = 'list' ]; then
862-
if [ "${localctl_available}" = "false" ]; then
862+
if [ "${localectl_available}" = "false" ]; then
863863
printf '%s\n' "INFO: 'localectl' unavailable, cannot list possible keyboard layouts."
864864
continue
865865
fi
@@ -890,7 +890,7 @@ Type 'exit' to quit without changing keyboard layout settings.
890890
## capitals, so we can't normalize everything to lowercase.
891891
variant_str="$(tr -d ' ' <<< "${variant_str}")"
892892
if [ "${variant_str,,}" = 'list' ]; then
893-
if [ "${localctl_available}" = "false" ]; then
893+
if [ "${localectl_available}" = "false" ]; then
894894
printf '%s\n' "INFO: 'localectl' unavailable, cannot list possible keyboard layouts."
895895
continue
896896
fi
@@ -934,7 +934,7 @@ Type 'exit' to quit without changing keyboard layout settings.
934934
## because some options like "eurosign:E" contain capital letters.
935935
option_str="$(tr -d ' ' <<< "${option_str}")"
936936
if [ "${option_str,,}" = 'list' ]; then
937-
if [ "${localctl_available}" = "false" ]; then
937+
if [ "${localectl_available}" = "false" ]; then
938938
printf '%s\n' "INFO: 'localectl' unavailable, cannot list possible keyboard layouts."
939939
continue
940940
fi

0 commit comments

Comments
 (0)