#!/usr/bin/env bash

#Translation
export TEXTDOMAINDIR="/usr/share/locale"
export TEXTDOMAIN=biglinux-webapps

if pidof webapp-manager-biglinux &>/dev/null;then
    yad --image=emblem-warning --image-on-top --form --width=500 --height=100 --fixed \
    --align=center \
    --text $"O Gerenciador de WebApps BigLinux já está aberto!" \
    --button=$" Fechar" \
    --center --on-top --borders=20 --title=$"BigLinux WebApps" \
    --window-icon=/usr/share/bigbashview/bcc/apps/biglinux-webapps/icons/webapp.svg
    exit
fi

#Translation
export TEXTDOMAINDIR="/usr/share/locale"
export TEXTDOMAIN=biglinux-webapps

# Criando diretórios necessários
mkdir -p ~/.bigwebapps
mkdir -p ~/.local/share/icons
mkdir -p ~/.local/share/applications
mkdir -p ~/.local/bin

if [ ! -e ~/.bigwebapps/BROWSER ];then
    /usr/share/bigbashview/bcc/apps/biglinux-webapps/check_browser.sh
fi

bigbashview -s 960x620 -n $"Gerenciador de WebApps BigLinux" \
            -i icons/webapp.svg -p "webapp-manager-biglinux" \
            -d "/usr/share/bigbashview/bcc/apps/biglinux-webapps"
