Pcmodcomputer / start.sh
THEZYZSTUDIO's picture
Update start.sh
096b4a3 verified
Raw
History Blame
1.53 kB
#!/bin/bash
# ══════════════════════════════════════════════════
# THE Z AI β€” Computer Mode Startup Script
# Starts: Virtual Display β†’ Desktop β†’ Python API
# ══════════════════════════════════════════════════
echo "πŸ–₯️ Starting Z Computer Mode Server..."
# ── 1. Start Virtual Display (1920x1080, 24-bit color) ──
Xvfb :1 -screen 0 1920x1080x24 -ac +extension GLX +render -noreset &
XVFB_PID=$!
echo "βœ… Xvfb started (PID: $XVFB_PID)"
sleep 2
# ── 2. Start Fluxbox window manager ──────────────────
export DISPLAY=:1
fluxbox &
FLUX_PID=$!
echo "βœ… Fluxbox started (PID: $FLUX_PID)"
sleep 1
# ── 3. Set wallpaper color (dark) ────────────────────
xsetroot -solid "#0d0d0d" &>/dev/null || true
# ── 4. Launch Firefox (ready for browsing tasks) ─────
firefox --no-sandbox --display=:1 &>/dev/null &
echo "βœ… Firefox launched"
sleep 2
# ── 5. Create Xauthority file (required by pyautogui/Xlib) ──
export XAUTHORITY=/home/zai/.Xauthority
touch $XAUTHORITY
xauth generate :1 . trusted 2>/dev/null || true
echo "βœ… Xauthority ready"
# ── 6. Start Python WebSocket API Server ─────────────
echo "πŸš€ Starting Python API on port ${PORT:-7860}..."
cd /app
exec python3 app.py