-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-mac.sh
More file actions
executable file
·99 lines (84 loc) · 2.48 KB
/
Copy pathsetup-mac.sh
File metadata and controls
executable file
·99 lines (84 loc) · 2.48 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
#!/bin/bash
# macOS setup: brew tools, fonts, iTerm2 themes, zsh config
set -euo pipefail
source "$(cd "$(dirname "$0")" && pwd)/lib.sh"
if [[ "$(uname)" != "Darwin" ]]; then
err "This script is for macOS only."
exit 1
fi
# Homebrew
info "Checking Homebrew..."
if ! command -v brew &>/dev/null; then
warn "Homebrew not found. Installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
ok "Homebrew installed"
else
ok "Homebrew found: $(brew --prefix)"
fi
# Brew packages
info "Installing CLI tools..."
BREW_FORMULAE=(
starship fzf fd eza bat btop fastfetch zoxide atuin cmatrix
zsh-autosuggestions zsh-fast-syntax-highlighting zsh-completions
)
BREW_CASKS=(
font-jetbrains-mono-nerd-font
font-hack-nerd-font
font-iosevka-nerd-font
)
for pkg in "${BREW_FORMULAE[@]}"; do
if brew list --formula "$pkg" &>/dev/null; then
ok "Already installed: $pkg"
else
info "Installing $pkg..."
brew install "$pkg"
fi
done
for cask in "${BREW_CASKS[@]}"; do
if brew list --cask "$cask" &>/dev/null; then
ok "Already installed: $cask"
else
info "Installing $cask..."
brew install --cask "$cask"
fi
done
# Symlinks
info "Symlinking config files..."
symlink_to "config/starship.toml" "$HOME/.config/starship.toml"
symlink_to "config/bat/config" "$HOME/.config/bat/config"
# iTerm2 color schemes
info "Importing iTerm2 color schemes..."
if [[ -d "$DOTFILES_DIR/iterm2" ]]; then
for scheme in "$DOTFILES_DIR"/iterm2/*.itermcolors; do
if [[ -f "$scheme" ]]; then
open "$scheme"
ok "Imported: $(basename "$scheme")"
fi
done
echo ""
warn "Color schemes imported into iTerm2."
warn "Select one in: iTerm2 > Settings > Profiles > Colors > Color Presets"
fi
# Wire cyberpunk.zsh into .zshrc
info "Configuring shell..."
ZSHRC="$HOME/.zshrc"
SOURCE_LINE="source \"$DOTFILES_DIR/zsh/cyberpunk.zsh\""
if [[ -f "$ZSHRC" ]] && grep -qF "cyberpunk.zsh" "$ZSHRC"; then
ok "cyberpunk.zsh already sourced in .zshrc"
else
{
echo ""
echo "# Cyberpunk terminal (managed by dotfiles)"
echo "$SOURCE_LINE"
} >> "$ZSHRC"
ok "Added source line to .zshrc"
fi
# Done
echo ""
printf "${CYAN}============================================================${NC}\n"
printf "${GREEN} macOS setup complete!${NC}\n"
printf "${CYAN}============================================================${NC}\n"
echo ""
echo "Restart your terminal or run: source ~/.zshrc"
echo ""