Watch
1
0
Fork
You've already forked souveraine
0

delivery: separate phone and laptop surface profiles

This commit is contained in:
Fimeg 2026-07-13 13:11:31 -04:00
commit 620c6778ce
4 changed files with 115 additions and 54 deletions

View file

@ -7,25 +7,24 @@ set -euo pipefail
usage() {
cat <<'EOF'
Usage: install-quickshell-surface.sh [--dry-run | --apply | --adopt]
Usage: install-quickshell-surface.sh [--dry-run]
--dry-run Show every file the Souveraine surface would manage (default).
--apply Install when every target is new or already Souveraine-managed.
--adopt Permit replacing existing ii files after preserving a timestamped
copy beside each conflict. Implies --apply.
--dry-run Show every file in the current development overlay (default).
Pacman should install surface assets only. This command is the explicit,
user-owned step that changes ~/.config/quickshell/ii.
The present development overlay mixes phone and laptop assumptions. It is not
safe to adopt wholesale on either device. Profile-specific manifests must land
before an apply/adopt mode is enabled. Pacman should install assets only.
EOF
}
mode=dry-run
adopt=false
while (($#)); do
case "$1" in
--dry-run) mode=dry-run ;;
--apply) mode=apply ;;
--adopt) mode=apply; adopt=true ;;
--apply|--adopt)
echo "Surface adoption is disabled until laptop and phone manifests are split." >&2
exit 2
;;
-h|--help) usage; exit 0 ;;
*) echo "unknown option: $1" >&2; usage >&2; exit 2 ;;
esac
@ -68,24 +67,4 @@ done < <("$DEPLOY" --manifest)
printf '\n%d managed, %d new, %d replacement(s).\n' \
"$managed_count" "$new_count" "${#conflicts[@]}"
if [[ "$mode" == dry-run ]]; then
echo "Dry run only; use --apply when there are no replacements, or --adopt to preserve and replace them."
exit 0
fi
if ((${#conflicts[@]}) > 0) && [[ "$adopt" != true ]]; then
echo "Refusing to replace existing ii files without --adopt. No files changed." >&2
exit 2
fi
if ((${#conflicts[@]}) > 0); then
stamp="$(date +%Y%m%d-%H%M%S)"
for target in "${conflicts[@]}"; do
dst="$QS/$target"
backup="${dst}.pre-souveraine-${stamp}"
cp -a -- "$dst" "$backup"
echo "preserved $target -> ${backup#$QS/}"
done
fi
exec "$DEPLOY"
echo "Dry run only. Profile-specific laptop/phone manifests are required before adoption can be enabled."