Fix & Upgrade

This commit is contained in:
csbae
2025-11-25 22:08:25 +09:00
parent 02a4f5f8e5
commit 674fb00148
6 changed files with 1174 additions and 59 deletions
+19
View File
@@ -0,0 +1,19 @@
# macOS
.DS_Store
.AppleDouble
.LSOverride
# Backups
*.backup_*
*.bak
# Temporary files
*.tmp
*.log
# Editor
.vscode/
.idea/
# Personal configs (if needed)
# personal-settings/
+241 -4
View File
@@ -1,8 +1,245 @@
# setup_mac # NAD4 Mac 초기 설정 스크립트
애플 실리콘 M프로세서 기준 MAC OS 세팅 script
## 실행 방법 Mac 개발 환경을 자동으로 설정하는 스크립트입니다.
```
## 📦 설치 항목
### 개발 도구
- Homebrew
- iTerm2
- Oh My Zsh
- zsh-syntax-highlighting
- zsh-autosuggestions
### 폰트
- D2Coding
- D2Coding Nerd Font
### 애플리케이션
- Cursor (에디터)
- Notion
- Discord
- Slack
- Google Chrome
- Telegram
- IINA (동영상 플레이어)
- KakaoTalk
- Tunnelblick (VPN)
- Stats (시스템 모니터)
## 🚀 사용 방법
### 초기 설치
```bash
# 1. 저장소 클론
cd ~/workspace
git clone <repository-url> nad4
# 2. 스크립트 실행
cd nad4/setup_mac
chmod +x setup_mac.sh chmod +x setup_mac.sh
./setup_mac.sh ./setup_mac.sh
``` ```
### 다른 Mac에서 설정 동기화
```bash
# 1. 저장소 클론
cd ~/workspace
git clone <repository-url> nad4
# 2. 스크립트 실행 (기존 설정 적용)
cd nad4/setup_mac
chmod +x setup_mac.sh
./setup_mac.sh
```
## 📁 프로젝트 구조
```
setup_mac/
├── setup_mac.sh # 메인 설치 스크립트
├── save_configs.sh # 설정 저장 스크립트
├── iterm2-settings/
│ └── profile.json # iTerm2 프로파일
├── stats-settings/
│ └── Stats.plist # Stats 설정
└── README.md # 이 파일
```
## ⚙️ 설정 내용
### iTerm2 프로파일
- **이름**: nad4-profile
- **폰트**: D2Coding 13pt
- **색상**: 다크 테마
- **Status Bar**: CPU, 메모리, 네트워크, 배터리, 호스트명
- **크기**: 100 columns × 25 rows
### ZSH 테마
- **테마**: agnoster (멀티라인)
- **플러그인**: syntax-highlighting, autosuggestions
### Stats 설정
- 자동으로 사용자 정의 설정 적용
- 메뉴바 위젯 자동 구성
- Launch at login 자동 설정
## 🔄 설정 업데이트
### 간편한 방법 (save_configs.sh 사용)
```bash
cd ~/workspace/nad4/setup_mac
# 1. Stats에서 원하는 설정 변경
# 2. iTerm2에서 프로파일 수정 (선택사항)
# 3. 설정 저장 스크립트 실행
./save_configs.sh
```
### 수동 방법
#### iTerm2 프로파일 변경 사항 저장
```bash
# 1. iTerm2에서 프로파일 수정 후 Export
# iTerm2 > Settings > Profiles > Other Actions... > Save Profile as JSON
# 2. 파일을 저장소로 이동
cd ~/workspace/nad4/setup_mac
mv ~/Downloads/nad4-profile.json iterm2-settings/profile.json
# 3. Git 커밋
git add iterm2-settings/profile.json
git commit -m "Update iTerm2 profile"
git push
```
#### Stats 설정 변경 사항 저장
```bash
# 1. Stats에서 원하는 설정 변경
# Settings에서 위젯, 색상, 업데이트 간격 등 조정
# 2. 설정 파일 저장소로 복사
cd ~/workspace/nad4/setup_mac
cp ~/Library/Preferences/eu.exelban.Stats.plist stats-settings/Stats.plist
# 3. Git 커밋
git add stats-settings/Stats.plist
git commit -m "Update Stats configuration"
git push
```
## 📋 설치 후 체크리스트
### iTerm2 설정
- [ ] iTerm2 > Settings > Profiles
- [ ] 'nad4-profile' 선택
- [ ] Other Actions... > Set as Default
- [ ] 새 창 열어서 설정 확인
### Stats 설정
- [ ] 메뉴바에서 Stats 위젯 표시 확인
- [ ] Settings > General > Launch at login 확인
- [ ] CPU, Memory 등 위젯 정상 작동 확인
### ZSH 확인
- [ ] 새 터미널에서 `echo $ZSH_THEME` → agnoster
- [ ] `type build_prompt` → 함수 정의 확인
- [ ] 프롬프트 2줄로 표시 확인
- [ ] Syntax highlighting 작동 확인
- [ ] Autosuggestions 작동 확인
## 🛠️ 문제 해결
### iTerm2 프로파일이 적용되지 않는 경우
```bash
# 1. 프로파일 파일 확인
ls -la ~/Library/Application\ Support/iTerm2/DynamicProfiles/
# 2. iTerm2 재시작
killall iTerm2
open -a iTerm2
```
### Stats 설정이 적용되지 않는 경우
```bash
# 1. Stats 완전 종료
killall Stats
# 2. 설정 파일 재적용
cd ~/workspace/nad4/setup_mac
cp stats-settings/Stats.plist ~/Library/Preferences/eu.exelban.Stats.plist
# 3. Stats 재시작
open -a Stats
```
### ZSH 테마 에러
```bash
# 백업에서 복원
cp ~/.zshrc.backup_YYYYMMDD_HHMMSS ~/.zshrc
exec zsh
```
### 폰트가 표시되지 않는 경우
```bash
# 폰트 재설치
brew reinstall --cask font-d2coding
brew reinstall --cask font-d2coding-nerd-font
# 폰트 캐시 삭제
sudo atsutil databases -remove
```
## 📦 설정 백업 및 복원
### 전체 설정 백업
```bash
cd ~/workspace/nad4/setup_mac
./save_configs.sh
```
### 전체 설정 복원
```bash
cd ~/workspace/nad4/setup_mac
# Git에서 최신 설정 가져오기
git pull
# 스크립트 실행 (자동으로 모든 설정 복원)
./setup_mac.sh
```
## 📚 참고 자료
- [Homebrew](https://brew.sh/)
- [iTerm2](https://iterm2.com/)
- [Oh My Zsh](https://ohmyz.sh/)
- [Stats](https://github.com/exelban/stats)
- [D2Coding Font](https://github.com/naver/d2codingfont)
## 💡 팁
### 빠른 설정 동기화
```bash
# 다른 Mac에서 5분 안에 모든 설정 복원
cd ~/workspace
git clone <repository-url> nad4
cd nad4/setup_mac
chmod +x setup_mac.sh
./setup_mac.sh
# 완료! iTerm2 재시작하면 모든 설정 적용됨
```
### 정기적인 설정 백업
```bash
# crontab으로 자동 백업 (선택사항)
crontab -e
# 매주 일요일 오후 6시에 설정 백업
0 18 * * 0 cd ~/workspace/nad4/setup_mac && cp ~/Library/Preferences/eu.exelban.Stats.plist stats-settings/Stats.plist && git add . && git commit -m "Auto backup: $(date)" && git push
```
## 📝 라이선스
MIT License
+326
View File
@@ -0,0 +1,326 @@
{
"Right Option Key Sends" : 0,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0.59999999999999998,
"Blue Component" : 0.73333333333333328,
"Red Component" : 0.42352941176470588
},
"Ansi 6 Color" : {
"Green Component" : 0.83853216239999995,
"Blue Component" : 0.8118151991,
"Red Component" : 0.49031879989999999
},
"Reduce Flicker" : false,
"Bold Color" : {
"Green Component" : 0.81568628549575806,
"Blue Component" : 0.81568628549575806,
"Red Component" : 0.81568628549575806
},
"Transparency" : 0,
"Normal Font" : "D2Coding 13",
"Ansi 2 Color" : {
"Green Component" : 0.55576569570000001,
"Blue Component" : 0.3144466675,
"Red Component" : 0.49473804389999998
},
"Rows" : 25,
"Default Bookmark" : "No",
"Custom Directory" : "No",
"Ansi 5 Color" : {
"Green Component" : 0.30697798579568808,
"Blue Component" : 0.52344669809931299,
"Red Component" : 0.62333851809954743
},
"Cursor Guide Color" : {
"Red Component" : 0.70214027166366577,
"Color Space" : "sRGB",
"Blue Component" : 1,
"Alpha Component" : 0.25,
"Green Component" : 0.92681378126144409
},
"Non-ASCII Anti Aliased" : true,
"Use Bright Bold" : true,
"Ansi 10 Color" : {
"Green Component" : 0.55576569570135748,
"Blue Component" : 0.31444666754949363,
"Red Component" : 0.49473804391474724
},
"Icon" : 0,
"Ambiguous Double Width" : false,
"Jobs to Ignore" : [
"rlogin",
"ssh",
"slogin",
"telnet"
],
"Show Status Bar" : true,
"Ansi 15 Color" : {
"Green Component" : 0.96078431606292725,
"Blue Component" : 0.96078431606292725,
"Red Component" : 0.96078431606292725
},
"Foreground Color" : {
"Green Component" : 0.81568628549575806,
"Blue Component" : 0.81568628549575806,
"Red Component" : 0.81568628549575806
},
"Bound Hosts" : [
],
"Working Directory" : "/Users/nad4",
"Blinking Cursor" : false,
"Disable Window Resizing" : true,
"Sync Title" : false,
"Prompt Before Closing 2" : false,
"BM Growl" : true,
"Command" : "/bin/zsh",
"Description" : "Default",
"Mouse Reporting" : true,
"Screen" : -1,
"Selection Color" : {
"Green Component" : 0.18823529779911041,
"Blue Component" : 0.18823529779911041,
"Red Component" : 0.18823529779911041
},
"Columns" : 100,
"Idle Code" : 0,
"Ansi 13 Color" : {
"Green Component" : 0.30697798580000002,
"Blue Component" : 0.5234466981,
"Red Component" : 0.62333851809999996
},
"Custom Command" : "Yes",
"ASCII Anti Aliased" : true,
"Non Ascii Font" : "Monaco 12",
"Vertical Spacing" : 1,
"Use Bold Font" : true,
"Option Key Sends" : 0,
"Selected Text Color" : {
"Green Component" : 0.81568628549575806,
"Blue Component" : 0.81568628549575806,
"Red Component" : 0.81568628549575806
},
"Background Color" : {
"Green Component" : 0.1283406391402715,
"Blue Component" : 0.1283406391402715,
"Red Component" : 0.1283406391402715
},
"Character Encoding" : 4,
"Ansi 11 Color" : {
"Green Component" : 0.70980392160000005,
"Blue Component" : 0.4039215686,
"Red Component" : 0.8980392157
},
"Use Italic Font" : true,
"Unlimited Scrollback" : false,
"Keyboard Map" : {
},
"Window Type" : 0,
"Initial Text" : "",
"Background Image Location" : "",
"Blur" : false,
"Badge Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Alpha Component" : 0.5,
"Green Component" : 0.14910027384757996
},
"Scrollback Lines" : 1000,
"Send Code When Idle" : false,
"Close Sessions On End" : true,
"Terminal Type" : "xterm-256color",
"Visual Bell" : true,
"Flashing Bell" : false,
"Status Bar Layout" : {
"components" : [
{
"class" : "iTermStatusBarCPUUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"shared text color" : {
"Red Component" : 0.90000000000000002,
"Color Space" : "sRGB",
"Blue Component" : 0.63,
"Alpha Component" : 1,
"Green Component" : 0.63
},
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"remove empty components" : false,
"font" : ".AppleSystemUIFont 12",
"algorithm" : 0,
"auto-rainbow style" : 1
}
}
},
{
"class" : "iTermStatusBarMemoryUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"shared text color" : {
"Red Component" : 0.80145,
"Color Space" : "sRGB",
"Blue Component" : 0.63,
"Alpha Component" : 1,
"Green Component" : 0.90000000000000002
},
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"remove empty components" : false,
"font" : ".AppleSystemUIFont 12",
"algorithm" : 0,
"auto-rainbow style" : 1
}
}
},
{
"class" : "iTermStatusBarNetworkUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"shared text color" : {
"Red Component" : 0.63,
"Color Space" : "sRGB",
"Blue Component" : 0.82710000000000006,
"Alpha Component" : 1,
"Green Component" : 0.90000000000000002
},
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"remove empty components" : false,
"font" : ".AppleSystemUIFont 12",
"algorithm" : 0,
"auto-rainbow style" : 1
}
}
},
{
"class" : "iTermStatusBarBatteryComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"shared text color" : {
"Red Component" : 0.65564999999999996,
"Color Space" : "sRGB",
"Blue Component" : 0.90000000000000002,
"Alpha Component" : 1,
"Green Component" : 0.63
},
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"remove empty components" : false,
"font" : ".AppleSystemUIFont 12",
"algorithm" : 0,
"auto-rainbow style" : 1
}
}
},
{
"class" : "iTermStatusBarHostnameComponent",
"configuration" : {
"knobs" : {
"path" : "hostname",
"base: priority" : 5,
"base: compression resistance" : 1,
"shared text color" : {
"Red Component" : 0.90000000000000002,
"Color Space" : "sRGB",
"Blue Component" : 0.77580000000000005,
"Alpha Component" : 1,
"Green Component" : 0.63
}
},
"layout advanced configuration dictionary value" : {
"remove empty components" : false,
"font" : ".AppleSystemUIFont 12",
"algorithm" : 0,
"auto-rainbow style" : 1
}
}
}
],
"advanced configuration" : {
"remove empty components" : false,
"font" : ".AppleSystemUIFont 12",
"algorithm" : 0,
"auto-rainbow style" : 1
}
},
"Show Timestamps" : 0,
"Silence Bell" : false,
"Unicode Normalization" : 1,
"Ansi 14 Color" : {
"Green Component" : 0.83853216239999995,
"Blue Component" : 0.8118151991,
"Red Component" : 0.49031879989999999
},
"Name" : "nad4-profile",
"Cursor Text Color" : {
"Green Component" : 0.08235294371843338,
"Blue Component" : 0.08235294371843338,
"Red Component" : 0.08235294371843338
},
"Shortcut" : "",
"Cursor Color" : {
"Green Component" : 0.81568628549575806,
"Blue Component" : 0.81568628549575806,
"Red Component" : 0.81568628549575806
},
"Ansi 0 Color" : {
"Green Component" : 0.08235294371843338,
"Blue Component" : 0.08235294371843338,
"Red Component" : 0.08235294371843338
},
"Guid" : "69F86086-C986-44CB-9F34-009303007028",
"Ansi 1 Color" : {
"Green Component" : 0.25490197539999998,
"Blue Component" : 0.2588235438,
"Red Component" : 0.67450982329999998
},
"Link Color" : {
"Red Component" : 0,
"Color Space" : "sRGB",
"Blue Component" : 0.73422712087631226,
"Alpha Component" : 1,
"Green Component" : 0.29151290413210518
},
"Horizontal Spacing" : 1,
"Ansi 3 Color" : {
"Green Component" : 0.70980392156862748,
"Blue Component" : 0.40392156862745099,
"Red Component" : 0.89803921568627454
},
"Use Non-ASCII Font" : false,
"Has Hotkey" : false,
"Ansi 8 Color" : {
"Green Component" : 0.31372550129890442,
"Blue Component" : 0.31372550129890442,
"Red Component" : 0.31372550129890442
},
"Ansi 9 Color" : {
"Green Component" : 0.25490197539999998,
"Blue Component" : 0.2588235438,
"Red Component" : 0.67450982329999998
},
"Ansi 7 Color" : {
"Green Component" : 0.81568628549575806,
"Blue Component" : 0.81568628549575806,
"Red Component" : 0.81568628549575806
},
"Ansi 4 Color" : {
"Green Component" : 0.59999999999999998,
"Blue Component" : 0.73333333329999995,
"Red Component" : 0.42352941179999998
}
}
+72
View File
@@ -0,0 +1,72 @@
#!/bin/bash
# =============================================================================
# 현재 설정을 Git 저장소로 저장하는 스크립트
# =============================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ITERM_SETTINGS_DIR="$SCRIPT_DIR/iterm2-settings"
STATS_SETTINGS_DIR="$SCRIPT_DIR/stats-settings"
echo "📦 현재 설정을 저장합니다..."
echo ""
# iTerm2 프로파일 저장 안내
echo "📝 iTerm2 프로파일 저장:"
echo " 1. iTerm2 > Settings > Profiles"
echo " 2. 'nad4-profile' 선택"
echo " 3. Other Actions... > Save Profile as JSON"
echo " 4. 파일명: profile.json"
echo " 5. 위치: $ITERM_SETTINGS_DIR/"
echo ""
read -p "iTerm2 프로파일을 저장했으면 Enter를 누르세요..." -r
# iTerm2 프로파일 확인
if [ -f "$ITERM_SETTINGS_DIR/profile.json" ]; then
echo "✅ iTerm2 프로파일 발견"
git add "$ITERM_SETTINGS_DIR/profile.json"
else
echo "⚠️ iTerm2 프로파일을 찾을 수 없습니다"
fi
echo ""
# Stats 설정 저장
if [ -f "$HOME/Library/Preferences/eu.exelban.Stats.plist" ]; then
echo "📊 Stats 설정 저장 중..."
cp "$HOME/Library/Preferences/eu.exelban.Stats.plist" \
"$STATS_SETTINGS_DIR/Stats.plist"
echo "✅ Stats 설정 저장 완료"
git add "$STATS_SETTINGS_DIR/Stats.plist"
else
echo "⚠️ Stats 설정 파일을 찾을 수 없습니다"
fi
echo ""
# Git 상태 확인
cd "$SCRIPT_DIR"
echo "📂 변경된 파일:"
git status --short
echo ""
echo "💾 Git 커밋을 진행하시겠습니까?"
read -p "커밋 메시지를 입력하세요 (Enter로 건너뛰기): " commit_msg
if [ -n "$commit_msg" ]; then
git commit -m "$commit_msg"
echo "✅ 커밋 완료"
read -p "원격 저장소에 푸시하시겠습니까? (y/N): " push_confirm
if [[ "$push_confirm" =~ ^[Yy]$ ]]; then
git push
echo "✅ 푸시 완료"
fi
else
echo "ℹ️ 커밋하지 않고 종료합니다"
fi
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📦 설정 저장 완료"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
Regular → Executable
+367 -53
View File
@@ -1,90 +1,404 @@
#!/bin/bash #!/bin/bash
echo "🚀 Mac 초기 개발 환경 설정을 시작합니다..." # =============================================================================
# Mac 초기 개발 환경 설정 스크립트
# 작성자: NAD4
# 설명: Homebrew, iTerm2, Oh My Zsh, 필수 앱 자동 설치 및 설정
# =============================================================================
# Homebrew 설치 set -e # 에러 발생 시 스크립트 중단
# 스크립트 실행 위치 확인
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ITERM_SETTINGS_DIR="$SCRIPT_DIR/iterm2-settings"
STATS_SETTINGS_DIR="$SCRIPT_DIR/stats-settings"
ITERM_PROFILE_FILE="$ITERM_SETTINGS_DIR/profile.json"
STATS_PLIST_FILE="$STATS_SETTINGS_DIR/Stats.plist"
echo "🚀 Mac 초기 개발 환경 설정을 시작합니다..."
echo "📂 스크립트 위치: $SCRIPT_DIR"
echo ""
# =============================================================================
# 1. Homebrew 설치
# =============================================================================
if ! command -v brew &> /dev/null; then if ! command -v brew &> /dev/null; then
echo "🔧 Homebrew 설치 중..." echo "🔧 Homebrew 설치 중..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Apple Silicon Mac의 경우 PATH 설정
if [[ $(uname -m) == "arm64" ]]; then
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)" eval "$(/opt/homebrew/bin/brew shellenv)"
fi
else else
echo "✅ Homebrew 이미 설치됨" echo "✅ Homebrew 이미 설치됨"
fi fi
echo "📦 Homebrew 업데이트 중..."
brew update brew update
# Nerd Fonts tap 추가 echo ""
echo "🔠 Nerd Fonts tap 추가..."
brew tap homebrew/cask-fonts
# iTerm2 설치 # =============================================================================
echo "📦 iTerm2 설치..." # 2. iTerm2 설치
brew install --cask iterm2 # =============================================================================
echo "📦 iTerm2 설치 중..."
# Oh My Zsh if brew list --cask iterm2 &> /dev/null; then
if [ ! -d "$HOME/.oh-my-zsh" ]; then echo "✅ iTerm2 이미 설치됨"
echo "📦 Oh My Zsh 설치..." else
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" brew install --cask iterm2
echo "✅ iTerm2 설치 완료"
fi fi
# ZSH 테마 및 멀티라인 프롬프트 설정 echo ""
echo "🎨 ZSH 테마 및 프롬프트 설정..."
sed -i '' 's/^ZSH_THEME=.*/ZSH_THEME="agnoster"/' ~/.zshrc
# =============================================================================
# 3. Oh My Zsh 설치
# =============================================================================
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo "📦 Oh My Zsh 설치 중..."
RUNZSH=no CHSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "✅ Oh My Zsh 설치 완료"
else
echo "✅ Oh My Zsh 이미 설치됨"
fi
echo ""
# =============================================================================
# 4. ZSH 플러그인 설치
# =============================================================================
echo "🔌 ZSH 플러그인 설치 중..."
# zsh-syntax-highlighting
if brew list zsh-syntax-highlighting &> /dev/null; then
echo "✅ zsh-syntax-highlighting 이미 설치됨"
else
brew install zsh-syntax-highlighting
echo "✅ zsh-syntax-highlighting 설치 완료"
fi
# zsh-autosuggestions
if brew list zsh-autosuggestions &> /dev/null; then
echo "✅ zsh-autosuggestions 이미 설치됨"
else
brew install zsh-autosuggestions
echo "✅ zsh-autosuggestions 설치 완료"
fi
echo ""
# =============================================================================
# 5. D2Coding 폰트 설치
# =============================================================================
echo "🔤 D2Coding 폰트 설치 중..."
# D2Coding 일반 폰트
if brew list --cask font-d2coding &> /dev/null; then
echo "✅ D2Coding 폰트 이미 설치됨"
else
brew install --cask font-d2coding
echo "✅ D2Coding 폰트 설치 완료"
fi
# D2Coding Nerd Font
if brew list --cask font-d2coding-nerd-font &> /dev/null; then
echo "✅ D2Coding Nerd Font 이미 설치됨"
else
brew install --cask font-d2coding-nerd-font
echo "✅ D2Coding Nerd Font 설치 완료"
fi
echo ""
# =============================================================================
# 6. GUI 애플리케이션 설치
# =============================================================================
echo "🖥️ GUI 애플리케이션 설치 중..."
# 설치할 앱 목록
APPS=(
"tunnelblick"
"cursor"
"notion"
"discord"
"iina"
"telegram"
"slack"
"google-chrome"
"stats"
)
for app in "${APPS[@]}"; do
if brew list --cask "$app" &> /dev/null; then
echo "$app 이미 설치됨"
else
echo "📦 $app 설치 중..."
brew install --cask "$app"
fi
done
echo ""
# =============================================================================
# 7. .zshrc 설정
# =============================================================================
echo "🎨 ZSH 설정 파일 구성 중..."
# 백업 생성
if [ -f ~/.zshrc ]; then
BACKUP_FILE="$HOME/.zshrc.backup_$(date +%Y%m%d_%H%M%S)"
cp ~/.zshrc "$BACKUP_FILE"
echo "✅ 기존 .zshrc 백업: $BACKUP_FILE"
fi
# 기존 NAD4 커스터마이징 제거 (중복 방지)
if [ -f ~/.zshrc ] && grep -q "# NAD4 Custom Prompt Config" ~/.zshrc; then
echo "🧹 기존 NAD4 설정 제거 중..."
sed -i '' '/# NAD4 Custom Prompt Config - START/,/# NAD4 Custom Prompt Config - END/d' ~/.zshrc
fi
# .zshrc 파일이 없으면 기본 템플릿 생성
if [ ! -f ~/.zshrc ]; then
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
fi
# ZSH_THEME 설정
if grep -q "^ZSH_THEME=" ~/.zshrc; then
sed -i '' 's/^ZSH_THEME=.*/ZSH_THEME="agnoster"/' ~/.zshrc
else
echo 'ZSH_THEME="agnoster"' >> ~/.zshrc
fi
# 멀티라인 프롬프트 설정 추가
cat << 'EOF' >> ~/.zshrc cat << 'EOF' >> ~/.zshrc
# agnoster 멀티라인 프롬프트 # NAD4 Custom Prompt Config - START
# agnoster 테마 멀티라인 프롬프트 커스터마이징
# 사용자@호스트명 숨기기
prompt_context() {} prompt_context() {}
# 디렉토리 표시 스타일
prompt_dir() { prompt_dir() {
prompt_segment blue black '%~' prompt_segment blue black '%~'
} }
# 줄바꿈 처리
prompt_newline() { prompt_newline() {
echo "\n$(print_prompt)" if [[ -n $CURRENT_BG ]]; then
echo -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR"
else
echo -n "%{%k%}"
fi
echo -n "%{%f%}"
CURRENT_BG=''
} }
precmd() {
# 프롬프트 빌드 (멀티라인 적용)
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
prompt_aws
prompt_context
prompt_dir
prompt_git
prompt_bzr
prompt_hg
prompt_newline prompt_newline
prompt_end
} }
# NAD4 Custom Prompt Config - END
EOF EOF
# zsh plugins # ZSH 플러그인 source 추가 (중복 체크)
echo "🔌 zsh 플러그인 설치..." SYNTAX_LINE='source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh'
brew install zsh-syntax-highlighting if ! grep -qxF "$SYNTAX_LINE" ~/.zshrc; then
echo "source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc echo "$SYNTAX_LINE" >> ~/.zshrc
fi
brew install zsh-autosuggestions SUGGEST_LINE='source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh'
echo "source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh" >> ~/.zshrc if ! grep -qxF "$SUGGEST_LINE" ~/.zshrc; then
echo "$SUGGEST_LINE" >> ~/.zshrc
fi
# GUI 앱 설치 echo "✅ .zshrc 설정 완료"
echo "🖥️ GUI 앱 설치 중..." echo ""
brew install --cask tunnelblick
brew install --cask cursor
brew install --cask notion
brew install --cask discord
brew install --cask iina
brew install --cask kakao-talk
brew install --cask telegram
brew install --cask slack
brew install --cask google-chrome
# D2Coding Nerd Font 설치 # =============================================================================
echo "🔤 D2Coding Nerd Font 설치..." # 8. iTerm2 프로파일 설정
brew install --cask font-d2coding-nerd-font # =============================================================================
echo "⚙️ iTerm2 프로파일 설정 중..."
# iTerm2 기본 폰트 설정 (D2Coding Nerd Font 14pt) # iTerm2가 실행 중이면 종료 (정확한 프로세스 이름 사용)
echo "⚙️ iTerm2 기본 폰트 설정 (D2Coding Nerd Font 14)..." if pgrep -x "iTerm2" > /dev/null; then
defaults write com.googlecode.iterm2 "New Bookmarks" -array-add \ echo "⚠️ iTerm2가 실행 중입니다. 종료합니다..."
'<dict> killall iTerm 2>/dev/null || killall iTerm2 2>/dev/null || true
<key>Normal Font</key> sleep 2
<string>D2Coding Nerd Font 14</string> fi
<key>name</key>
<string>Default</string>
</dict>'
# zsh 적용 # iTerm2 DynamicProfiles 디렉토리 생성
echo "🔁 zsh 설정 적용 중..." ITERM_DYNAMIC_DIR="$HOME/Library/Application Support/iTerm2/DynamicProfiles"
source ~/.zshrc mkdir -p "$ITERM_DYNAMIC_DIR"
# 프로파일 파일 확인
if [ -f "$ITERM_PROFILE_FILE" ]; then
echo "✅ profile.json 발견"
# DynamicProfile 형식으로 변환하여 복사
cat > "$ITERM_DYNAMIC_DIR/NAD4Profile.json" << 'DYNAMIC_WRAPPER'
{
"Profiles": [
DYNAMIC_WRAPPER
# 기존 프로파일 내용 추가 (마지막 } 제거)
cat "$ITERM_PROFILE_FILE" | sed '$ d' >> "$ITERM_DYNAMIC_DIR/NAD4Profile.json"
# 래퍼 종료
cat >> "$ITERM_DYNAMIC_DIR/NAD4Profile.json" << 'DYNAMIC_WRAPPER'
}
]
}
DYNAMIC_WRAPPER
echo "✅ iTerm2 Dynamic Profile 생성 완료"
echo " 위치: $ITERM_DYNAMIC_DIR/NAD4Profile.json"
# profile.json에서 GUID 추출
PROFILE_GUID=$(grep -o '"Guid" : "[^"]*"' "$ITERM_PROFILE_FILE" | sed 's/"Guid" : "\(.*\)"/\1/')
if [ -n "$PROFILE_GUID" ]; then
echo "✅ 프로파일 GUID: $PROFILE_GUID"
# iTerm2 환경설정에 기본 프로파일 GUID만 설정
defaults write com.googlecode.iterm2 "Default Bookmark Guid" "$PROFILE_GUID"
echo "✅ iTerm2 기본 프로파일 GUID 설정 완료"
else
echo "⚠️ 프로파일 GUID를 찾을 수 없습니다"
fi
else
echo "⚠️ $ITERM_PROFILE_FILE 파일을 찾을 수 없습니다."
fi
# iTerm2 재시작 (번들 ID 사용)
echo "🔄 iTerm2 시작 중..."
sleep 1
# iTerm2 실행 (여러 방법 시도)
if [ -d "/Applications/iTerm.app" ]; then
open -a /Applications/iTerm.app
echo "✅ iTerm2 시작 완료"
elif command -v open &> /dev/null; then
open -b com.googlecode.iterm2 2>/dev/null || \
open /Applications/iTerm.app 2>/dev/null || \
echo "⚠️ iTerm2를 수동으로 실행해주세요"
else
echo "⚠️ iTerm2를 수동으로 실행해주세요"
fi
echo "" echo ""
echo "🎉 모든 Mac 초기 설정이 완료되었습니다!"
echo "💡 iTerm2 > Settings > Profiles > Text 탭에서 폰트가 'D2Coding Nerd Font'로 설정되었는지 확인하세요." # =============================================================================
# 9. Stats 앱 설정
# =============================================================================
echo "📊 Stats 앱 설정 중..."
if brew list --cask stats &> /dev/null; then
echo "✅ Stats 설치됨"
# Stats가 실행 중이면 종료
if pgrep -x "Stats" > /dev/null; then
echo "⚠️ Stats가 실행 중입니다. Stats를 종료합니다..."
killall Stats 2>/dev/null || true
sleep 2
fi
# Stats 설정 파일 확인
if [ -f "$STATS_PLIST_FILE" ]; then
echo "✅ Stats.plist 발견"
# Stats 설정 파일 백업
STATS_PREF_FILE="$HOME/Library/Preferences/eu.exelban.Stats.plist"
if [ -f "$STATS_PREF_FILE" ]; then
STATS_BACKUP="$STATS_PREF_FILE.backup_$(date +%Y%m%d_%H%M%S)"
cp "$STATS_PREF_FILE" "$STATS_BACKUP"
echo "✅ 기존 Stats 설정 백업: $STATS_BACKUP"
fi
# 새 설정 적용
cp "$STATS_PLIST_FILE" "$STATS_PREF_FILE"
echo "✅ Stats 설정 적용 완료"
# 설정 파일 권한 설정
chmod 644 "$STATS_PREF_FILE"
# Stats 재시작
echo "🔄 Stats 재시작 중..."
sleep 1
open -a Stats
echo "✅ Stats 시작 완료"
else
echo "⚠️ $STATS_PLIST_FILE 파일을 찾을 수 없습니다."
echo " Stats를 실행하고 수동으로 설정해주세요."
fi
else
echo "⚠️ Stats가 설치되지 않았습니다."
fi
echo ""
# =============================================================================
# 완료 메시지
# =============================================================================
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🎉 Mac 초기 개발 환경 설정이 완료되었습니다!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📋 다음 단계:"
echo ""
echo " 1️⃣ iTerm2 실행 확인"
echo " → iTerm이 자동으로 열렸는지 확인"
echo " → 열리지 않았다면: Spotlight (⌘Space) → 'iTerm' 검색"
echo ""
echo " 2️⃣ iTerm2에서 프로파일 설정 (필수 - 30초):"
echo " ┌──────────────────────────────────────────┐"
echo " │ iTerm2 > Settings (⌘,) │"
echo " │ → Profiles 탭 │"
echo " │ → 왼쪽에서 'nad4-profile' 선택 │"
echo " │ → 하단 'Other Actions...' 클릭 │"
echo " │ → 'Set as Default' 선택 │"
echo " └──────────────────────────────────────────┘"
echo ""
echo " 3️⃣ 새 창 열어서 프로파일 확인 (⌘N)"
echo " ✓ 어두운 배경 (#1F1F1F)"
echo " ✓ D2Coding 13pt 폰트"
echo " ✓ 하단 Status Bar (CPU, Memory, Network, Battery, Host)"
echo " ✓ 100 columns × 25 rows"
echo ""
echo " 4️⃣ ZSH 테마 확인 (새 터미널에서):"
echo " echo \$ZSH_THEME # → agnoster"
echo " type build_prompt # → function 확인"
echo ""
echo " 5️⃣ Stats 메뉴바 위젯 확인"
echo " → 메뉴바 오른쪽에 시스템 모니터 표시"
echo ""
echo "💡 참고:"
echo " - Dynamic Profile: ✅ 생성 완료"
echo " - 기본 GUID 설정: ✅ 완료"
echo " - Stats 설정: ✅ 적용 완료"
echo " - 최종 단계: 2단계 프로파일 설정만 진행하면 끝!"
echo ""
echo "🔧 문제 발생 시:"
echo " - iTerm2가 실행 안 되면: Spotlight에서 'iTerm' 검색 후 실행"
echo " - 프로파일 목록에 nad4-profile 없으면:"
echo " Settings > Profiles > Other Actions > Import JSON"
echo " → iterm2-settings/profile.json 선택"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
+147
View File
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Battery_notifications_high</key>
<string></string>
<key>Battery_notifications_low</key>
<string>low</string>
<key>Battery_state</key>
<false/>
<key>Bluetooth_state</key>
<false/>
<key>CPU_barChart_position</key>
<integer>3</integer>
<key>CPU_label_position</key>
<integer>2</integer>
<key>CPU_lineChart_position</key>
<integer>1</integer>
<key>CPU_line_chart_color</key>
<string>utilization</string>
<key>CPU_mini_color</key>
<string>monochrome</string>
<key>CPU_mini_position</key>
<integer>0</integer>
<key>CPU_oneView</key>
<true/>
<key>CPU_pieChart_position</key>
<integer>4</integer>
<key>CPU_state</key>
<true/>
<key>CPU_tachometer_position</key>
<integer>5</integer>
<key>CPU_widget</key>
<string>mini</string>
<key>CombinedModules</key>
<false/>
<key>CombinedModules_spacing</key>
<string>1</string>
<key>Disk_notifications_utilization_state</key>
<false/>
<key>Disk_state</key>
<true/>
<key>GPU_state</key>
<true/>
<key>LaunchAtLoginNext</key>
<true/>
<key>NSNavPanelExpandedSizeForSaveMode</key>
<string>{880, 448}</string>
<key>NSNavPanelExpandedStateForSaveMode</key>
<true/>
<key>NSToolbar Configuration eu.exelban.Stats.Settings.Toolbar</key>
<dict>
<key>TB Display Mode</key>
<integer>1</integer>
<key>TB Icon Size Mode</key>
<integer>1</integer>
<key>TB Is Shown</key>
<true/>
<key>TB Size Mode</key>
<integer>1</integer>
</dict>
<key>Network_base</key>
<string>byte</string>
<key>Network_label_position</key>
<integer>1</integer>
<key>Network_networkChart_position</key>
<integer>2</integer>
<key>Network_speed_icon</key>
<string>arrows</string>
<key>Network_speed_iconColor</key>
<string>transparent</string>
<key>Network_speed_position</key>
<integer>0</integer>
<key>Network_state</key>
<true/>
<key>Network_state_position</key>
<integer>3</integer>
<key>Network_text_position</key>
<integer>4</integer>
<key>Network_widget</key>
<string>speed</string>
<key>RAM_barChart_position</key>
<integer>3</integer>
<key>RAM_label_position</key>
<integer>1</integer>
<key>RAM_lineChart_position</key>
<integer>2</integer>
<key>RAM_memory_position</key>
<integer>5</integer>
<key>RAM_mini_color</key>
<string>monochrome</string>
<key>RAM_mini_position</key>
<integer>0</integer>
<key>RAM_notifications_pressure_state</key>
<false/>
<key>RAM_pieChart_position</key>
<integer>4</integer>
<key>RAM_state</key>
<true/>
<key>RAM_tachometer_position</key>
<integer>6</integer>
<key>RAM_text_position</key>
<integer>7</integer>
<key>RAM_widget</key>
<string>mini</string>
<key>Sensors_barChart_position</key>
<integer>3</integer>
<key>Sensors_fanControl</key>
<true/>
<key>Sensors_hid</key>
<true/>
<key>Sensors_label_position</key>
<integer>2</integer>
<key>Sensors_mini_position</key>
<integer>0</integer>
<key>Sensors_sensor</key>
<string>PSTR</string>
<key>Sensors_stack_position</key>
<integer>1</integer>
<key>Sensors_state</key>
<true/>
<key>Sensors_widget</key>
<string>mini</string>
<key>fan_0_mode</key>
<integer>0</integer>
<key>fan_0_speed</key>
<integer>4900</integer>
<key>runAtLoginInitialized</key>
<true/>
<key>sensor_Average CPU</key>
<false/>
<key>sensor_PSTR</key>
<false/>
<key>sensor_Total System Consumption</key>
<false/>
<key>setupProcess</key>
<true/>
<key>support_ts</key>
<integer>1761583096</integer>
<key>telemetry</key>
<false/>
<key>updater_check_ts</key>
<integer>1763380987</integer>
<key>version</key>
<string>2.11.61</string>
</dict>
</plist>