# This script is generated by FTWA
# /u/ links are only available for 24h
# Check the app store to find more apps: https://ftwa.mathix.dev/store

# Exit on error
set -e;

# Setup Firefox if needed
# Firefox setup skipped

echo "
Creating desktop entry...";
tmpdir="$(mktemp -d)";
tmp_desktop_file="$tmpdir/ftwa-dysperse.desktop";

cat > $tmp_desktop_file <<EOF
[Desktop Entry]
Type=Application
Name=Dysperse
Exec=/usr/bin/google-chrome-stable --app='https://app.dysperse.com'
Icon=ftwa-dysperse
Terminal=false
StartupNotify=true
StartupWMClass=ftwa-dysperse

# This file was generated using FTWA (https://ftwa.mathix.dev)
EOF

icon_path="$tmpdir/ftwa-dysperse.png";
curl -fsSLo $icon_path 'https://s6.imgcdn.dev/pUmiL.png';

xdg-desktop-menu install $tmp_desktop_file;
xdg-icon-resource install --size 1024 "${tmpdir}/ftwa-dysperse.png" 'ftwa-dysperse';

echo "Desktop entry created.";