#!/bin/bash
DISPLAY=:0 nohup /home/pi/rpvlcdmp/./remote.sh &
# loop because intial vlc instance usually crashes
for i in 1 2 3 4 5
do
   	if ps -C vlc > /dev/null
	then
		echo "vlc running"
	else
		nohup vlc &
		sleep 3
                DISPLAY=:0 wmctrl -a VLC
		# set focus to vlc
		DISPLAY=:0 xdotool key F11
		# maximize window
		sleep 2
	fi
done
