# 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-claude-ai.desktop";

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

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

icon_path="$tmpdir/ftwa-claude-ai.png";
curl -fsSLo $icon_path 'https://i.ibb.co/YW0wgq4/377114602-556fda8f-6a64-41ac-8e79-68f9065134d0.png';

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

echo "Desktop entry created.";