#!/bin/bash # Get the current macOS appearance APPEARANCE=$(defaults read -g AppleInterfaceStyle 2>/dev/null) CLAUDE_SETTINGS="$HOME/.claude/settings.json" # Determine which theme to use if [[ "$APPEARANCE" == "Dark" ]]; then CLAUDE_THEME="dark" else # Light mode (or if AppleInterfaceStyle is not set) CLAUDE_THEME="light" fi # Update Claude Code theme if [ -f "$CLAUDE_SETTINGS" ]; then # Use jq to update the theme if command -v jq &> /dev/null; then jq --arg theme "$CLAUDE_THEME" '. + {theme: $theme}' "$CLAUDE_SETTINGS" > "$CLAUDE_SETTINGS.tmp" && \ mv "$CLAUDE_SETTINGS.tmp" "$CLAUDE_SETTINGS" echo "Claude Code switched to $CLAUDE_THEME mode" else echo "Error: jq is required but not installed. Install with: brew install jq" exit 1 fi else # Create settings file with theme if it doesn't exist echo "{\"theme\": \"$CLAUDE_THEME\"}" > "$CLAUDE_SETTINGS" echo "Created Claude settings with $CLAUDE_THEME mode" fi