Fix iTerm2 theme application and install Orca

This commit is contained in:
nad4 committed 2026-09-30 22:53:55 +09:00
1 parent 17ca503163
commit 83827d1312
4 files changed
+54 -69

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROFILE_FILE="$SCRIPT_DIR/iterm2-settings/profile.json"
DYNAMIC_DIR="$HOME/Library/Application Support/iTerm2/DynamicProfiles"
TARGET_FILE="$DYNAMIC_DIR/NAD4Profile.json"
# Validate before replacing the active profile. Backups belong outside DynamicProfiles.
plutil -convert xml1 -o /dev/null "$PROFILE_FILE"
PROFILE_GUID=$(plutil -extract Guid raw -o - "$PROFILE_FILE")
PROFILE_NAME=$(plutil -extract Name raw -o - "$PROFILE_FILE")
[ -n "$PROFILE_GUID" ] && [ -n "$PROFILE_NAME" ]
mkdir -p "$DYNAMIC_DIR"
if [ -f "$TARGET_FILE" ]; then
BACKUP_DIR="$HOME/Library/Application Support/iTerm2/ProfileBackups"
mkdir -p "$BACKUP_DIR"
cp "$TARGET_FILE" "$BACKUP_DIR/NAD4Profile.$(date +%Y%m%d_%H%M%S).json"
fi
TEMP_FILE=$(mktemp "${TMPDIR:-/tmp}/nad4-iterm.XXXXXX")
trap 'rm -f "$TEMP_FILE"' EXIT
{
printf '{"Profiles": ['
cat "$PROFILE_FILE"
printf ']}\n'
} > "$TEMP_FILE"
plutil -convert xml1 -o /dev/null "$TEMP_FILE"
cp "$TEMP_FILE" "$TARGET_FILE"
defaults write com.googlecode.iterm2 "Default Bookmark Guid" -string "$PROFILE_GUID"
echo "✅ iTerm2 기본 프로파일 적용: $PROFILE_NAME"
echo " 기존 세션은 유지됩니다. 새 창(⌘N)에서 테마와 폰트를 확인하세요."