main
 1#!/data/data/com.termux/files/usr/bin/bash
 2# Sync Light Phone (suzu) Termux config from the home repo
 3# Run after cloning: ~/src/home/android/suzu/sync.sh
 4set -euo pipefail
 5
 6DEVICE_DIR="$HOME/src/home/android/suzu"
 7COMMON_DIR="$HOME/src/home/android/common"
 8
 9if [ ! -d "$DEVICE_DIR" ]; then
10    echo "Error: home repo not found at ~/src/home"
11    echo "Clone it first: git clone <repo> ~/src/home"
12    exit 1
13fi
14
15echo "==> Installing packages..."
16pkg install -y openssh git zsh curl wget rsync jq mosh htop ripgrep 2>/dev/null || true
17
18echo "==> Syncing SSH config..."
19mkdir -p ~/.ssh
20chmod 700 ~/.ssh
21ln -snf "$COMMON_DIR/ssh_config" ~/.ssh/config
22chmod 600 ~/.ssh/config 2>/dev/null || true
23
24echo "==> Syncing Termux config..."
25mkdir -p ~/.termux
26ln -snf "$DEVICE_DIR/termux.properties" ~/.termux/termux.properties
27# Keep default dark colors — no colors.properties override
28
29echo "==> Syncing shell config..."
30ln -snf "$DEVICE_DIR/zshrc" ~/.zshrc
31
32echo "==> Syncing bin..."
33mkdir -p ~/bin
34for f in "$COMMON_DIR"/bin/*; do
35    ln -snf "$f" ~/bin/"$(basename "$f")"
36done
37
38echo "==> Reloading Termux settings..."
39termux-reload-settings 2>/dev/null || true
40
41echo "==> Setting zsh as default shell..."
42chsh -s zsh 2>/dev/null || chsh -s "$PREFIX/bin/zsh" 2>/dev/null || true
43
44echo "==> Pulling latest from repo..."
45(cd ~/src/home && git pull --ff-only 2>/dev/null || echo "  ⚠️  Could not fast-forward, run git pull manually")
46
47echo "✅ Sync complete!"