diff options
Diffstat (limited to 'addons/locales.sh')
-rw-r--r-- | addons/locales.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/addons/locales.sh b/addons/locales.sh new file mode 100644 index 00000000..17f0fb10 --- /dev/null +++ b/addons/locales.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# T&M Hansson IT AB © - 2020, https://www.hanssonit.se/ + +# shellcheck disable=2034,2059 +true +# shellcheck source=lib.sh +. <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh) + +# Must be root +root_check + +# Set locales +print_text_in_color "$ICyan" "Setting locales..." +if [ "$KEYBOARD_LAYOUT" = "us" ] +then + print_text_in_color "$ICyan" "US locales are already set." +elif [ "$KEYBOARD_LAYOUT" = "se" ] +then + sudo locale-gen "sv_SE.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales +elif [ "$KEYBOARD_LAYOUT" = "de" ] +then + sudo locale-gen "de_DE.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales +elif [ "$KEYBOARD_LAYOUT" = "us" ] +then + sudo locale-gen "en_US.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales +elif [ "$KEYBOARD_LAYOUT" = "fr" ] +then + sudo locale-gen "fr_FR.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales +elif [ "$KEYBOARD_LAYOUT" = "ch" ] +then + sudo locale-gen "de_CH.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales +fi + +# TODO: "localectl list-x11-keymap-layouts" and pair with "cat /etc/locale.gen | grep UTF-8" |