#!/bin/bash
SYSCONFCMD="/usr/bin/sysconf"
SPK_CONF="/etc/speaker.conf"

/usr/bin/startxfce4 &
#matchbox-window-manager -use_titlebar no &

sleep 1

xset s off
xset s noblank
xset -dpms

URL="`${SYSCONFCMD} ${SPK_CONF} get remote_cast url`"


while [ 1 ]
do
    CHR_STAT="`ps -ef | grep 'chromium' | grep -v grep`"
    if [ -z "${CHR_STAT}" ];then
            /usr/bin/chromium --kiosk --noerrdialogs --disable-infobars --disable-session-crashed-bubble --disable-features=TranslateUI ${URL} > /dev/null 2>&1 &
    fi
    sleep 15
done
