One annoying thing in antiX Linux is updating after installing when unused locales is not removed. The file which locales are generated is /etc/locale.gen file. When commenting out (#) lines no to use, these locales do no generate when updating the system. Locales generating takes a lot of CPU time if many locales are generated.
Locales can set using a command
sudo dpkg-reconfigure locales
Or faster way is to edit /etc/locale.gen file using some editor. Or make an one locale file using a script
The script:
#!/bin/bash
## RJP 10.1.2025
# locale.gen file maker
#
sed 's/#//g' < /etc/locale.gen > /tmp/locale.gen.new
sed -i "s/^\(.*\)/# \1/" /tmp/locale.gen.new
LOCALE=$(/tmp/locale.gen.new)
choose=$(cat /tmp/locale.gen.new | \
yad --list --text="Choose the locale" --title="locale.gen file maker" --height=500 --width=600 --center \
--column="locale $LOCALE")
--button=Exit:1
cat "$choose" 2> /tmp/valinta.txt
cat /tmp/valinta.txt | awk '{print $3,$4}' > /tmp/valinta2
sed 's/.$//' /tmp/valinta2 > /tmp/valinta3
sed 's/.$//' /tmp/valinta3 > /tmp/valinta4
sed 's/.$//' /tmp/valinta4 > ~/locale.gen
## to check if locale is correct
geany ~/locale.gen
## if locale is correct, you can copy it as /etc/locale.gen
If locale is correct, generated locale.gen file can copy to the /etc directory.
sudo cp /etc/locale.gen /etc/locale.gen.bak && sudo cp ~/locale.gen /etc/locale.gen
###############################
Edit 13.1.2025 Full version with question dialog.
The code:
#!/bin/bash
## RJP 10.1.2025
# locale.gen file maker
# 13.10.2024 full version
#
sed 's/#//g' < /etc/locale.gen > /tmp/locale.gen.new
sed -i "s/^\(.*\)/# \1/" /tmp/locale.gen.new
LOCALE=$(/tmp/locale.gen.new)
choose=$(cat /tmp/locale.gen.new | \
yad --list --text="Choose the locale" --title="locale.gen file maker" --height=500 --width=600 --center \
--column="locale $LOCALE")
--button=Exit:1
cat "$choose" 2> /tmp/valinta.txt
cat /tmp/valinta.txt | awk '{print $3,$4}' > /tmp/valinta2
sed 's/.$//' /tmp/valinta2 > /tmp/valinta3
sed 's/.$//' /tmp/valinta3 > /tmp/valinta4
sed 's/.$//' /tmp/valinta4 > ~/locale.gen
## to check if locale is correct
geany ~/locale.gen
## if locale is correct, you can copy it as /etc/locale.gen
yad --text="Would you like change /etc/locale.gen file with new settings?" --title="Change settings"
if [ $? = 0 ];
then
x-terminal-emulator -e /bin/bash -c "sudo cp /etc/locale.gen /etc/locale.gen.bak && sudo cat ~/locale.gen >> /tmp/locale.gen.new && sudo cp /tmp/locale.gen.new /etc/locale.gen && yad --center --borders=5 --width=400 --text-align=center --button=gtk-ok:1 --title='locale.gen changed' --buttons-layout=center"
else exit 0
fi