This script:
- Detects the current user automatically.
- Installs/upgrades Antigravity IDE.
- Fixes sandbox permissions.
- Creates/updates the desktop shortcut.
- Validates the desktop file.
- Starts Antigravity IDE.
#!/usr/bin/env bash
set -Eeuo pipefail
APP_NAME=“Antigravity IDE”
ARCHIVE_NAME=“Antigravity IDE.tar.gz”
INSTALL_DIR=“$HOME/.local/share/antigravity-ide”
DESKTOP_FILE=“$HOME/.local/share/applications/antigravity.desktop”
TARBALL=“$HOME/Downloads/$ARCHIVE_NAME”
echo “================================================”
echo “Installing / Upgrading $APP_NAME”
echo “================================================”
if [[ ! -f “$TARBALL” ]]; then
echo “ERROR: Installer not found:”
echo “$TARBALL”
exit 1
fi
echo “[1/8] Stopping existing instances…”
pkill -f antigravity-ide || true
echo “[2/8] Creating temporary workspace…”
TMPDIR=$(mktemp -d)
cleanup() {
rm -rf “$TMPDIR”
}
trap cleanup EXIT
echo “[3/8] Extracting package…”
tar -xzf “$TARBALL” -C “$TMPDIR”
EXTRACTED_DIR=$(find “$TMPDIR” -mindepth 1 -maxdepth 1 -type d | head -n1)
if [[ -z “$EXTRACTED_DIR” ]]; then
echo “ERROR: Unable to locate extracted directory.”
exit 1
fi
echo “[4/8] Preparing installation directory…”
mkdir -p “$INSTALL_DIR”
rm -f “$INSTALL_DIR/chrome-sandbox”
echo “[5/8] Syncing files…”
rsync -a --delete
“$EXTRACTED_DIR/”
“$INSTALL_DIR/”
chmod +x “$INSTALL_DIR/antigravity-ide”
echo “[6/8] Configuring chrome sandbox…”
sudo chown root:root “$INSTALL_DIR/chrome-sandbox”
sudo chmod 4755 “$INSTALL_DIR/chrome-sandbox”
echo “[7/8] Creating desktop launcher…”
mkdir -p “$(dirname “$DESKTOP_FILE”)”
cat > “$DESKTOP_FILE” <<EOF
[Desktop Entry]
Name=Antigravity IDE
Comment=AI Powered IDE
GenericName=IDE
Exec=$INSTALL_DIR/antigravity-ide
Icon=$INSTALL_DIR/resources/app/resources/linux/code.png
Terminal=false
Type=Application
Categories=Development;IDE;
StartupNotify=true
StartupWMClass=antigravity-ide
MimeType=x-scheme-handler/antigravity;text/html;
EOF
chmod 644 “$DESKTOP_FILE”
if command -v desktop-file-validate >/dev/null 2>&1; then
desktop-file-validate “$DESKTOP_FILE”
fi
if command -v update-desktop-database >/dev/null 2>&1; then
update-desktop-database “$HOME/.local/share/applications/” || true
fi
echo “[8/8] Verifying installation…”
stat -c ‘%A %U:%G %n’
“$INSTALL_DIR/antigravity-ide”
“$INSTALL_DIR/chrome-sandbox”
echo
echo “Starting Antigravity IDE…”
nohup “$INSTALL_DIR/antigravity-ide” >/dev/null 2>&1 &
echo
echo “================================================”
echo “Antigravity IDE installation completed.”
echo “================================================”
Save as:
install-antigravity.sh
Make executable:
chmod +x install-antigravity.sh
Run:
./install-antigravity.sh
Assumptions
The script expects the downloaded file to exist at:
~/Downloads/Antigravity IDE.tar.gz