#!/bin/bash
cierralanzador
APPRUTA="`dirname "$0"`"
cd "$APPRUTA"
PROG=`basename $(pwd)`.xml
RUN=`echo "#run:$PROG"`


pgrep -f SimpleHTTPServer|xargs kill -9 &
sleep 1

if [ -e "/opt/snap/$PROG" ];then
    rm "/opt/snap/$PROG"
    ln -s "$APPRUTA/$PROG" "/opt/snap/$PROG"
else
    ln -s "$APPRUTA/$PROG" "/opt/snap/$PROG"
fi

cd /opt/snap/

python -m SimpleHTTPServer &

#google-chrome --start-fullscreen http://localhost:8000/snap.html$RUN

firefox -p default http://localhost:8000/snap.html$RUN &
#xdotool search --sync --onlyvisible --class "Firefox" windowactivate key F11
sleep 8; wmctrl -r "Mozilla Firefox" -b toggle,fullscreen > /tmp/a
