#!/bin/bash
set -e

DISPLAY_NUM=:0
VT=vt3
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

if pgrep -x Xorg > /dev/null; then
    echo "Xorg already running"
else
    sudo Xorg "$DISPLAY_NUM" "$VT" &
    sleep 1
fi

DISPLAY="$DISPLAY_NUM" python3 "$SCRIPT_DIR/display.py" --fullscreen
