#!/usr/bin/env bash # Setup iTerm2 with Nord theme and matching Kitty settings set -euo pipefail DOTFILES_DIR="$HOME/dotfiles" ITERM_CONFIG_DIR="$DOTFILES_DIR/config/iterm2" # Colors GREEN='\033[0;32m' YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' echo -e "${BLUE}Setting up iTerm2 configuration...${NC}" # 1. Tell iTerm2 to use custom preferences folder echo -e "${YELLOW}Configuring iTerm2 to use dotfiles preferences...${NC}" defaults write com.googlecode.iterm2 PrefsCustomFolder -string "$ITERM_CONFIG_DIR" defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true # 2. Set specific preferences matching Kitty config echo -e "${YELLOW}Setting iTerm2 preferences to match Kitty...${NC}" # Font settings (Iosevka Term SS08, 16pt - matching Kitty) defaults write com.googlecode.iterm2 "Normal Font" -string "IosevkaTermSS08-Regular 16" defaults write com.googlecode.iterm2 "Non Ascii Font" -string "FiraCodeNerdFontComplete-Regular 16" # Enable ligatures defaults write com.googlecode.iterm2 "ASCII Ligatures" -bool true # Window size (120x35 characters) defaults write com.googlecode.iterm2 "Columns" -int 120 defaults write com.googlecode.iterm2 "Rows" -int 35 # Transparency (matching Kitty's 0.92 opacity = 8% transparency) defaults write com.googlecode.iterm2 "Transparency" -float 0.08 # Scrollback lines (10000) defaults write com.googlecode.iterm2 "Scrollback Lines" -int 10000 # Visual bell instead of audio defaults write com.googlecode.iterm2 "Silence Bell" -bool false defaults write com.googlecode.iterm2 "Visual Bell" -bool true # Copy on selection defaults write com.googlecode.iterm2 "Copy to Pasteboard on Selection" -bool true # Cursor settings defaults write com.googlecode.iterm2 "Cursor Type" -int 0 # Block cursor defaults write com.googlecode.iterm2 "Blinking Cursor" -bool true echo -e "${GREEN}✅ iTerm2 preferences configured${NC}" echo "" echo -e "${YELLOW}To complete the setup:${NC}" echo "1. Open iTerm2" echo "2. Go to Preferences > Profiles > Colors" echo "3. Click 'Color Presets...' dropdown" echo "4. Select 'Import...' and choose: $ITERM_CONFIG_DIR/Nord.itermcolors" echo "5. Select 'Nord' from the Color Presets dropdown" echo "" echo "Optional: Export your full iTerm2 config:" echo " Preferences > General > Preferences" echo " Click 'Save settings to Folder' and choose: $ITERM_CONFIG_DIR"