Merge cn-region-switch (with omarchy #13690)
# Conflicts: # AGENTS.md # bin/omarchy-refresh-pacman # default/omarchy/omarchy-menu.jsonc # install/post-install/pacman.sh # shell/plugins/menu/MenuModel.js # test/shell.d/menu-test.sh
This commit is contained in:
35 files changed
+918
-7
No files matched your search
@@ -1,3 +1,4 @@
|
||||
run_logged "$OMARCHY_INSTALL/config/region.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/theme-system.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/browser-policy.sh"
|
||||
run_logged "$OMARCHY_INSTALL/config/increase-lockout-limit.sh"
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
cn_links=(
|
||||
"environment.conf /etc/environment.d/90-omarchy-china.conf"
|
||||
"cargo.toml /.cargo/config.toml"
|
||||
"gemrc /etc/gemrc"
|
||||
)
|
||||
|
||||
# The installer writes the marker from the timezone; 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
|
||||
for link in "${cn_links[@]}"; do
|
||||
read -r _ target <<<"$link"
|
||||
if [[ -L $target && $(readlink "$target") == */default/regions/cn/* ]]; then
|
||||
rm "$target"
|
||||
fi
|
||||
done
|
||||
;;
|
||||
cn)
|
||||
for link in "${cn_links[@]}"; do
|
||||
read -r _ target <<<"$link"
|
||||
if [[ -e $target && ! -L $target ]]; then
|
||||
echo "Refusing to replace $target, which Omarchy did not create" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
mkdir -p /etc/omarchy
|
||||
echo cn >/etc/omarchy/region
|
||||
for link in "${cn_links[@]}"; do
|
||||
read -r source target <<<"$link"
|
||||
mkdir -p "${target%/*}"
|
||||
ln -sfn "$OMARCHY_PATH/default/regions/cn/$source" "$target"
|
||||
done
|
||||
;;
|
||||
*)
|
||||
echo "Unknown region: $region" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -21,8 +21,13 @@ fi
|
||||
# rc on aarch64) gets the platform's default channel instead.
|
||||
channel=${OMARCHY_MIRROR:-}
|
||||
[[ -n $channel && -f $templates/pacman-$channel.conf ]] || channel=$(omarchy_pacman_default_channel "$platform")
|
||||
cp -f "$templates/pacman-$channel.conf" /etc/pacman.conf
|
||||
cp -f "$templates/mirrorlist-$channel" /etc/pacman.d/mirrorlist
|
||||
# Regions render x86 pacman only (omarchy #13690).
|
||||
if [[ $platform == x86 ]]; then
|
||||
"$OMARCHY_PATH/bin/omarchy-apply-pacman" "$channel"
|
||||
else
|
||||
cp -f "$templates/pacman-$channel.conf" /etc/pacman.conf
|
||||
cp -f "$templates/mirrorlist-$channel" /etc/pacman.d/mirrorlist
|
||||
fi
|
||||
|
||||
# An image build leaves the keyring to each machine's first boot, so no two
|
||||
# share a master key (install/helpers/image-target.sh).
|
||||
|
||||
Reference in new issue
Block a user