#!/bin/bash
# Launch dedicated AGENT Chrome: own profile, CDP 9223, display :99 (headful)
exec > /tmp/amdwork/launch_chrome.out 2>&1
export DISPLAY=:99
nohup /usr/bin/google-chrome \
  --user-data-dir=/home/claude/chrome-profile-agent \
  --remote-debugging-port=9223 \
  --remote-debugging-address=127.0.0.1 \
  --no-first-run \
  --no-default-browser-check \
  --disable-gpu-compositing \
  --ozone-platform=x11 \
  --window-position=0,0 \
  --window-size=1440,900 \
  --lang=en-US \
  about:blank \
  > /tmp/amdwork/chrome-agent.log 2>&1 &
echo "launched pid=$!"
sleep 6
echo "=== CDP version ==="
curl -s http://localhost:9223/json/version || echo "9223 NOT UP"
echo ""
echo "=== DONE LAUNCH ==="
