Spaces:
Paused
Paused
| # ββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # 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 | |