Merge reworked #13690: timezone-derived region and channel mirror prepends
Drop the .cn servers.sed twins, the USTC Arch fallback and the closed #14399 timezone preselection. region.sh follows the installer's marker.
This commit is contained in:
commit
4521dac023
25 files changed
+150
-206
No files matched your search
@@ -4,7 +4,14 @@ cn_links=(
|
||||
"gemrc /etc/gemrc"
|
||||
)
|
||||
|
||||
case ${OMARCHY_REGION:-global} in
|
||||
# The installer writes the marker; omarchy-region passes the region it switches to.
|
||||
region=global
|
||||
if [[ -e /etc/omarchy/region ]]; then
|
||||
region=$(</etc/omarchy/region)
|
||||
fi
|
||||
region=${OMARCHY_REGION:-$region}
|
||||
|
||||
case $region in
|
||||
global)
|
||||
rm -f /etc/omarchy/region
|
||||
sed -i 's/^LANG=zh_CN\.UTF-8$/LANG=en_US.UTF-8/' /etc/locale.conf
|
||||
@@ -41,7 +48,7 @@ cn)
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Unknown OMARCHY_REGION: $OMARCHY_REGION" >&2
|
||||
echo "Unknown region: $region" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -216,13 +216,10 @@ omarchy_prompt_hostname() {
|
||||
}
|
||||
|
||||
# A fresh machine often hasn't joined a network yet, so the geo guess fails
|
||||
# often; guard it or a `set -e` caller dies before the filter fallback. Callers
|
||||
# may pass the zone to preselect when there is no guess (a region's default),
|
||||
# so an offline install does not open on the top of an alphabetical list.
|
||||
# often; guard it or a `set -e` caller dies before the filter fallback.
|
||||
omarchy_prompt_timezone() {
|
||||
local guess status
|
||||
guess=$(tzupdate -p 2>/dev/null) || guess=""
|
||||
[[ -n $guess ]] || guess="${1:-}"
|
||||
|
||||
if [[ -n $guess ]]; then
|
||||
timezone=$(timedatectl list-timezones | gum choose --height 10 --selected "$guess" --header "$(omarchy_text "Timezone")") && status=0 || status=$?
|
||||
|
||||
Reference in new issue
Block a user