#!/usr/bin/env sh
if [ ! -e /usr/lib/librewolf/librewolf ];then
    /usr/bin/biglinux-webapp "firelibre"
    exit
fi

FOLDER=~/.bigwebapps/instagram-webapp-biglinux-librewolf
CLASS="webapp-instagram-webapp-biglinux-librewolf"

if [ ! -d "$FOLDER" ];then
    mkdir -p "$FOLDER/chrome"
    cp -a /usr/share/bigbashview/bcc/apps/biglinux-webapps/profile/userChrome.css "$FOLDER/chrome"
    cp -a /usr/share/bigbashview/bcc/apps/biglinux-webapps/profile/user.js "$FOLDER"
fi

MOZ_DISABLE_GMP_SANDBOX=1 MOZ_DISABLE_CONTENT_SANDBOX=1 \
XAPP_FORCE_GTKWINDOW_ICON=/usr/share/icons/hicolor/128x128/apps/webapp-instagram.svg \
librewolf --class="$CLASS" --profile "$FOLDER" --no-remote --new-instance "https://www.instagram.com" &
