# Laptop Setup: Superwhisper + Codex Config Sync This note exists so the laptop setup can be done quickly without having to reconstruct the discussion. ## What this is for There are two separate things to set up on the laptop: 1. Superwhisper auto-hide, so its window stops reappearing constantly. 2. Codex config sync, so changes to `~/.codex` are automatically exported to `~/.codex-config`, committed, and pushed. ## What to say to Codex Normal phrasing should be enough. Examples: - `Show my Google Calendar list.` - `Add a task to Google Tasks.` - `Create a Google Doc.` The intended Codex behavior is: - try `gws` normally first - if the current instance shows a clear network/DNS/sandbox failure, escalate immediately on retry - do not keep dithering after that ## 1. Superwhisper auto-hide Paste this block into Terminal on the laptop and press Enter: ```bash h="$HOME" mkdir -p "$h/Library/Scripts" "$h/Library/LaunchAgents" cat > "$h/Library/Scripts/hide-superwhisper.sh" <<'EOF' #!/bin/bash PAUSE_FILE="$HOME/.superwhisper-hide-until" if [[ -f "$PAUSE_FILE" ]]; then until_ts="$(cat "$PAUSE_FILE" 2>/dev/null)" now="$(date +%s)" if [[ "$until_ts" =~ ^[0-9]+$ ]] && (( now < until_ts )); then exit 0 fi fi /usr/bin/osascript <<'APPLESCRIPT' tell application "System Events" if exists process "superwhisper" then set visible of process "superwhisper" to false end if end tell APPLESCRIPT EOF chmod +x "$h/Library/Scripts/hide-superwhisper.sh" cat > "$h/Library/Scripts/pause-superwhisper-hide.sh" <<'EOF' #!/bin/bash mins="${1:-10}" /usr/bin/date -v+"${mins}"M +%s > "$HOME/.superwhisper-hide-until" EOF chmod +x "$h/Library/Scripts/pause-superwhisper-hide.sh" cat > "$h/Library/LaunchAgents/com.nickyoung.hide-superwhisper.plist" <<'EOF' <?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>Label</key> <string>com.nickyoung.hide-superwhisper</string> <key>ProgramArguments</key> <array> <string>/bin/bash</string> <string>/Users/$USER/Library/Scripts/hide-superwhisper.sh</string> </array> <key>RunAtLoad</key> <true/> <key>StartInterval</key> <integer>5</integer> </dict> </plist> EOF /usr/bin/sed -i "s|/Users/\\$USER|$h|g" "$h/Library/LaunchAgents/com.nickyoung.hide-superwhisper.plist" launchctl unload "$h/Library/LaunchAgents/com.nickyoung.hide-superwhisper.plist" >/dev/null 2>&1 || true launchctl load "$h/Library/LaunchAgents/com.nickyoung.hide-superwhisper.plist" ``` If macOS asks for automation or accessibility permissions, allow them. ## 2. Codex config auto-sync Paste this block into Terminal on the laptop and press Enter: ```bash h="$HOME" r="$h/.codex-config" l="$h/Library/LaunchAgents/com.nickyoung.codex-config-autosync.plist" cd "$r" git pull "$r/scripts/apply-to-live.sh" mkdir -p "$r/logs" chmod +x "$r/scripts/auto-sync.sh" cat > "$l" <<'EOF' <?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>Label</key> <string>com.nickyoung.codex-config-autosync</string> <key>ProgramArguments</key> <array> <string>/bin/bash</string> <string>/Users/$USER/.codex-config/scripts/auto-sync.sh</string> </array> <key>RunAtLoad</key> <true/> <key>StartInterval</key> <integer>60</integer> <key>StandardOutPath</key> <string>/Users/$USER/.codex-config/logs/launchd-stdout.log</string> <key>StandardErrorPath</key> <string>/Users/$USER/.codex-config/logs/launchd-stderr.log</string> </dict> </plist> EOF /usr/bin/sed -i "s|/Users/\\$USER|$h|g" "$l" launchctl unload "$l" >/dev/null 2>&1 || true launchctl load "$l" "$r/scripts/auto-sync.sh" ``` Result: - laptop pulls the latest `~/.codex-config` - laptop applies it into live `~/.codex` - laptop gets the same 60-second auto-sync job - future Codex config changes on the laptop will auto-commit and auto-push