#!/bin/sh
MIR_SOCKET=/run/mir_socket
URL="https://www.google.com"
while ! test -S "$MIR_SOCKET" ; do
echo "Waiting for '$MIR_SOCKET'"
sleep 5
done
echo "Found '$MIR_SOCKET', starting..."
# Workaround detection logic that causes webapp-container to segfault
if [ -d "$SNAP_USER_DATA" ] ; then
echo "Removing '$SNAP_USER_DATA/.{cache,config,local,last_revision,themes}'"
rm -rf "$SNAP_USER_DATA/.cache"
rm -rf "$SNAP_USER_DATA/.config"
rm -rf "$SNAP_USER_DATA/.local"
rm -rf "$SNAP_USER_DATA/.last_revision"
rm -rf "$SNAP_USER_DATA/.themes"
fi
webapp-launcher "$URL" --fullscreen --enable-back-forward --enable-addressbar