-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·53 lines (44 loc) · 1.73 KB
/
install.sh
File metadata and controls
executable file
·53 lines (44 loc) · 1.73 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
#!/usr/bin/env bash
set -e
# Colors using tput (portable and readable)
if [[ -t 1 ]]; then
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
BLUE=$(tput setaf 4)
YELLOW=$(tput setaf 3)
RESET=$(tput sgr0)
else
RED='' GREEN='' BLUE='' YELLOW='' RESET=''
fi
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo -e "${BLUE}Installing dotfiles...${RESET}\n"
# 1. Install Homebrew (includes Xcode CLI tools)
if ! command -v brew &> /dev/null; then
echo -e "${YELLOW}→ Installing Homebrew...${RESET}"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add to PATH for Apple Silicon
[[ -f /opt/homebrew/bin/brew ]] && eval "$(/opt/homebrew/bin/brew shellenv)"
else
echo -e "${GREEN}✓ Homebrew already installed${RESET}"
fi
# 2. Install packages
echo -e "\n${YELLOW}→ Installing packages...${RESET}"
brew bundle --file="$DOTFILES_DIR/Brewfile"
# 3. Symlink dotfiles
echo -e "\n${YELLOW}→ Symlinking dotfiles...${RESET}"
"$DOTFILES_DIR/stow.sh"
# 4. macOS settings (optional)
echo -e "\n${YELLOW}→ Apply macOS settings? (y/N)${RESET}"
read -r response
if [[ "$response" =~ ^[Yy]$ ]]; then
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock mineffect -string "scale"
defaults write com.apple.dock tilesize -int 48
killall Dock
echo -e "${GREEN}✓ macOS settings applied${RESET}"
fi
echo -e "\n${GREEN}✓ Done! Restart your terminal.${RESET}"