summaryrefslogtreecommitdiff
path: root/configs/mate-openrc/root-image/root/.language.sh
diff options
context:
space:
mode:
authorDavid P <megver83@openmailbox.org>2017-09-29 14:18:19 -0300
committerDavid P <megver83@openmailbox.org>2017-09-29 14:18:19 -0300
commitf5d62fdcd4a6d351fa25af3b3e443ba4de67a802 (patch)
treeda3bb909024f145454fb7ff460931bbb8c4311af /configs/mate-openrc/root-image/root/.language.sh
parent50a0dc41d6edbe36d081bcd0fab7d79f2a0d116a (diff)
Added configs/profile-openrc
Diffstat (limited to 'configs/mate-openrc/root-image/root/.language.sh')
-rwxr-xr-xconfigs/mate-openrc/root-image/root/.language.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/configs/mate-openrc/root-image/root/.language.sh b/configs/mate-openrc/root-image/root/.language.sh
new file mode 100755
index 0000000..d12cb61
--- /dev/null
+++ b/configs/mate-openrc/root-image/root/.language.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+finish=0 #If change locale the system need restart session to see the changes
+
+#Comprobe if language was selected
+code=$(cat ~/.codecheck | grep LANG= | tail --bytes 2)
+if [ $code = "0" ]; then
+ lang=$(zenity --list --title="Select your locale" --column="Locale" --column="Language" \
+ "en_US.UTF-8" "English" \
+ "gl_ES.UTF-8" "Galego" \
+ "es_ES.UTF-8" "Spanish" \
+ "pt_BR.UTF-8" "Brazilian Portuguese")
+
+ #Copy locale in locale.conf
+ echo "LANG=$lang" > /etc/locale.conf
+
+ #Put a new line confirm that language was selected
+ sed -i '/LANG=./d' ~/.codecheck
+ echo "LANG=1" >> ~/.codecheck
+
+ #Copy icewm menu in that language and scripts to install
+ cp -a ~/.icewm/menuLanguages/menu_${lang/_*/} ~/.icewm/menu
+ cp -a ~/.scriptsInstallation/language/${lang/_*/}/* ~/.scriptsInstallation/
+
+ finish=1
+fi
+
+# Save keymap as "us" so it starts next login
+sed -i '/XKBMAP=./d' ~/.codecheck
+echo "XKBMAP=us" >> ~/.codecheck
+
+if [ $finish -eq 1 ]; then
+ #Restart session
+ pkill -KILL -u root
+fi