#!/usr/bin/env bash # iCloud Drive for Linux — uninstaller set -euo pipefail INSTALL_DIR="$HOME/.local/lib/icloud-linux" GUI_INSTALL="$HOME/.local/lib/icloud-gui" BIN_DIR="$HOME/.local/bin" DESKTOP_DIR="$HOME/.local/share/applications" ICONS_DIR="$HOME/.local/share/icons/hicolor/scalable/apps" echo "This will remove:" echo " $INSTALL_DIR (backend)" echo " $GUI_INSTALL (GUI)" echo " $BIN_DIR/icloud-drive" echo " $DESKTOP_DIR/com.elementary.icloud-linux.desktop" echo "" read -rp "Continue? [y/N] " ans [[ "$ans" =~ ^[Yy]$ ]] || { echo "Aborted."; exit 0; } # Stop the service first if running if command -v icloudctl &>/dev/null || [ -f "$INSTALL_DIR/icloudctl" ]; then "$INSTALL_DIR/icloudctl" stop 2>/dev/null || true fi rm -rf "$INSTALL_DIR" "$GUI_INSTALL" rm -f "$BIN_DIR/icloud-drive" rm -f "$DESKTOP_DIR/com.elementary.icloud-linux.desktop" rm -f "$ICONS_DIR/com.elementary.icloud-linux.svg" update-desktop-database "$DESKTOP_DIR" 2>/dev/null || true gtk-update-icon-cache -f -t "$HOME/.local/share/icons/hicolor" 2>/dev/null || true echo "Uninstalled. Your config (~/.config/icloud-linux) and cache (~/.cache/icloud-linux) were left intact." echo "Remove them manually if you want a clean slate:" echo " rm -rf ~/.config/icloud-linux ~/.cache/icloud-linux"