#!/bin/bash # Wait for VNC server to start sleep 2 while ! xdpyinfo -display $DISPLAY &> /dev/null; do echo "XServer not responsive, retrying..." sleep 2 done echo "XServer has been found, running desktop environment" # Run desktop environment (XFCE) dbus-launch xfce4-session --display=$DISPLAY