tiny-desktop / scripts /start-desktop.sh
Likho User
Fix: Wait for X server to be ready before starting app
eeffe53
raw
history blame contribute delete
611 Bytes
#!/bin/bash
set -e
# Start VNC
echo "Starting VNC..."
su - vncuser -c "vncserver ${DISPLAY} -geometry 1280x720 -depth 24 -localhost no -SecurityTypes None --I-KNOW-THIS-IS-INSECURE"
# Start noVNC
echo "Starting noVNC..."
websockify --web=/usr/share/novnc ${NO_VNC_PORT} localhost:${VNC_PORT} &
# Wait for X server to be ready
echo "Waiting for X server..."
for i in {1..30}; do
if xdotool getdisplaygeometry >/dev/null 2>&1; then
echo "X server is ready."
break
fi
echo "Waiting for X server... ($i/30)"
sleep 1
done
# Start App
echo "Starting App..."
cd /app
python3 app.py