-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
172 lines (146 loc) · 8.45 KB
/
Copy pathinstall.sh
File metadata and controls
172 lines (146 loc) · 8.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/data/data/com.termux/files/usr/bin/bash
# ╔══════════════════════════════════════════════════════════════╗
# ║ SYNDOT — Dotfiles Installer for Termux ║
# ║ Powered by GNU Stow ║
# ╚══════════════════════════════════════════════════════════════╝
set -e # Exit immediately on any error
# ─── Colors ────────────────────────────────────────────────────
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
BOLD='\033[1m'
RESET='\033[0m'
# ─── Helpers ───────────────────────────────────────────────────
info() { echo -e "${CYAN}${BOLD}[syndot]${RESET} $*"; }
success() { echo -e "${GREEN}${BOLD}[ ok ]${RESET} $*"; }
warn() { echo -e "${YELLOW}${BOLD}[ warn ]${RESET} $*"; }
die() { echo -e "${RED}${BOLD}[ fail ]${RESET} $*"; exit 1; }
banner() {
echo -e "${CYAN}${BOLD}"
cat <<'EOF'
███████╗██╗ ██╗███╗ ██╗██████╗ ██████╗ ████████╗
██╔════╝╚██╗ ██╔╝████╗ ██║██╔══██╗██╔═══██╗╚══██╔══╝
███████╗ ╚████╔╝ ██╔██╗ ██║██║ ██║██║ ██║ ██║
╚════██║ ╚██╔╝ ██║╚██╗██║██║ ██║██║ ██║ ██║
███████║ ██║ ██║ ╚████║██████╔╝╚██████╔╝ ██║
╚══════╝ ╚═╝ ╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═╝
EOF
echo -e "${RESET}"
echo -e " ${BOLD}Dotfiles installer for Termux — powered by GNU Stow${RESET}"
echo -e " ─────────────────────────────────────────────────────\n"
}
# ══════════════════════════════════════════════════════════════
# STEP 0 — Banner
# ══════════════════════════════════════════════════════════════
banner
# ══════════════════════════════════════════════════════════════
# STEP 1 — Storage & Package Update
# ══════════════════════════════════════════════════════════════
info "Setting up Termux storage access..."
termux-setup-storage
success "Storage setup done."
info "Updating package lists and upgrading installed packages..."
pkg update -y && pkg upgrade -y
success "System updated."
# ══════════════════════════════════════════════════════════════
# STEP 2 — Add Repos (tur-repo, termux-void)
# Must be done before installing packages that live in them
# ══════════════════════════════════════════════════════════════
info "Installing extra repositories (tur-repo, termux-void)..."
pkg install -y tur-repo
curl -sL https://termuxvoid.github.io/repo/install.sh | bash -s -- -s
pkg update -y
success "Repos added and index refreshed."
# ══════════════════════════════════════════════════════════════
# STEP 3 — Install All Packages
# ══════════════════════════════════════════════════════════════
info "Installing all required packages..."
PACKAGES=(
zsh
neovim
lua-language-server
termux-api
termux-tools
clangd
cmake
yazi
glow
git
wget
tmux
bat
zoxide
eza
fzf
fzy
lazygit
gcc
man
tealdeer
starship
nala
ripgrep
fd
fastfetch
stow
)
for pkg in "${PACKAGES[@]}"; do
info " Installing: ${BOLD}${pkg}${RESET}"
pkg install -y "$pkg" || warn " '$pkg' failed — skipping (may not exist in current repos)."
done
success "All packages installed."
# ══════════════════════════════════════════════════════════════
# STEP 4 — Clone Dotfiles Repo
# ══════════════════════════════════════════════════════════════
DOTFILES_DIR="$HOME/dotfiles"
if [[ -d "$DOTFILES_DIR" ]]; then
warn "~/dotfiles already exists — removing before fresh clone..."
rm -rf "$DOTFILES_DIR"
fi
info "Cloning dotfiles from GitHub..."
git clone https://github.com/synthyst/dotfiles
success "Dotfiles cloned to $DOTFILES_DIR"
# ══════════════════════════════════════════════════════════════
# STEP 5 — Remove Conflicting Configs
# ══════════════════════════════════════════════════════════════
info "Removing existing configs that would conflict with stow..."
TARGETS=(
"$HOME/.config"
"$HOME/.termux"
"$HOME/.zshrc"
"$HOME/.bashrc"
"$HOME/scripts"
)
for target in "${TARGETS[@]}"; do
if [[ -e "$target" || -L "$target" ]]; then
rm -rf "$target"
success " Removed: $target"
else
warn " Not found (skipping): $target"
fi
done
success "Conflict cleanup done."
# ══════════════════════════════════════════════════════════════
# STEP 6 — Stow Dotfiles
# ══════════════════════════════════════════════════════════════
info "Stowing dotfiles..."
cd "$DOTFILES_DIR"
stow .
success "Dotfiles stowed successfully."
# ══════════════════════════════════════════════════════════════
# STEP 7 — Set Default Shell to Zsh
# ══════════════════════════════════════════════════════════════
info "Setting default shell to zsh..."
chsh -s zsh
success "Default shell changed to zsh."
# ══════════════════════════════════════════════════════════════
# DONE
# ══════════════════════════════════════════════════════════════
echo ""
echo -e "${GREEN}${BOLD}╔══════════════════════════════════════════════════╗${RESET}"
echo -e "${GREEN}${BOLD}║ Syndot install complete! Restart Termux to ║${RESET}"
echo -e "${GREEN}${BOLD}║ load your fresh zsh environment. Enjoy! ║${RESET}"
echo -e "${GREEN}${BOLD}╚══════════════════════════════════════════════════╝${RESET}"
echo ""
exit