├── .github └── images │ └── preview.gif ├── LICENSE ├── README.md └── cursor-cleaner.sh /.github/images/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/killerlux/cursor-cleaner/HEAD/.github/images/preview.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🧹 Cursor Trial resetter 2 | 3 | A powerful, interactive script for completely removing the Cursor application and its associated configuration data from Debian/Ubuntu systems. This script features a beautiful terminal UI with animations, progress bars, and color-coded output. 4 | 5 | ![Terminal Preview](https://raw.githubusercontent.com/killerlux/cursor-cleaner/main/.github/images/preview.gif) 6 | 7 | ## ✨ Features 8 | 9 | ### Core Functionality 10 | - 🔄 Complete Cursor application removal 11 | - 🗑️ Thorough cleanup of all associated files 12 | - 🆔 System machine ID reset capability 13 | - 🧹 Comprehensive system cleanup 14 | 15 | ### UI/UX Enhancements 16 | - 🎨 Rich color-coded output for better readability 17 | - 🔄 Loading spinners for background tasks 18 | - 📊 Progress bars for long operations 19 | - ✨ Interactive confirmations 20 | - 🎯 Clear section headers and visual organization 21 | - 📝 Detailed operation feedback 22 | - 🚦 Status indicators and symbols 23 | 24 | ## ⚠️ Important Warnings 25 | 26 | 1. **HIGHLY DESTRUCTIVE**: Uses `rm -rf` for forceful deletion 27 | 2. **DATA LOSS**: Permanently removes all Cursor settings and data 28 | 3. **MACHINE ID RESET**: Requires system reboot 29 | 4. **NO GUARANTEES**: May not bypass all trial mechanisms 30 | 5. **USE AT YOUR OWN RISK**: Review code before running 31 | 6. **ETHICAL USE**: Respect software licenses 32 | 33 | ## 🛠️ System Requirements 34 | 35 | - **OS**: Debian/Ubuntu or derivative 36 | - **Core**: systemd 37 | - **Shell**: Bash 38 | - **Utilities**: 39 | - coreutils (rm, cat) 40 | - systemd 41 | - sudo access 42 | - apt package manager 43 | - **Terminal**: Supports ANSI color codes 44 | 45 | ## 📋 What It Removes 46 | 47 | - ⚡ Running Cursor processes 48 | - 📦 AppImage files 49 | - 📁 Extracted AppImage directories 50 | - ⚙️ Configuration data: 51 | - ~/.config/Cursor 52 | - ~/.cache/Cursor 53 | - ~/.local/share/Cursor 54 | - ~/.cursor* 55 | - 🖥️ Desktop entries and icons 56 | - 🆔 System machine ID (with reset) 57 | 58 | ## 🚀 Installation & Usage 59 | 60 | 1. **Download the script**: 61 | ```bash 62 | wget https://raw.githubusercontent.com/killerlux/cursor-cleaner/main/cursor-cleaner.sh 63 | ``` 64 | 65 | 2. **Make it executable**: 66 | ```bash 67 | chmod +x cursor-cleaner.sh 68 | ``` 69 | 70 | 3. **Run the script**: 71 | ```bash 72 | ./cursor-cleaner.sh 73 | ``` 74 | 75 | 4. **Follow the interactive prompts**: 76 | - Read and acknowledge warnings 77 | - Confirm execution 78 | - Enter sudo password when prompted 79 | - Choose whether to reboot immediately 80 | 81 | ## 🔧 Configuration 82 | 83 | The script includes configurable variables at the top: 84 | 85 | ```bash 86 | # Default Downloads directory (Common on English systems) 87 | DOWNLOADS_DIR="$HOME/Downloads" 88 | 89 | # French Downloads directory (Uncomment if needed) 90 | # DOWNLOADS_DIR="$HOME/Téléchargements" 91 | 92 | # AppImage pattern to match 93 | APPIMAGE_PATTERN="Cursor-*.AppImage" 94 | 95 | # Default extraction directory 96 | EXTRACTED_DIR="$HOME/squashfs-root" 97 | ``` 98 | 99 | ## 🎨 Color Scheme 100 | 101 | The script uses a carefully chosen color scheme for different types of messages: 102 | - 🟦 Blue: Information messages 103 | - 🟨 Yellow: Warnings and cautions 104 | - 🟩 Green: Success messages 105 | - 🟥 Red: Error messages 106 | - 🟪 Magenta: Section headers 107 | - 🟦 Cyan: Progress indicators 108 | 109 | ## 🤝 Contributing 110 | 111 | Contributions are welcome! Here's how you can help: 112 | 1. Fork the repository 113 | 2. Create your feature branch 114 | 3. Commit your changes 115 | 4. Push to the branch 116 | 5. Open a Pull Request 117 | 118 | ## 📝 License 119 | 120 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. 121 | 122 | ## ⚠️ Disclaimer 123 | 124 | This script is provided "as is" without warranty of any kind. Use at your own risk. The author(s) are not responsible for any damage or data loss caused by using this script. 125 | 126 | ## 🙏 Support 127 | 128 | If you find this tool useful, consider: 129 | - ⭐ Starring the repository 130 | - 🐛 Reporting issues 131 | - 🔀 Contributing improvements 132 | - 📢 Sharing with others 133 | -------------------------------------------------------------------------------- /cursor-cleaner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ============================================================================== 4 | # == Cursor Cleaner & Machine ID Reset Script (Debian/Ubuntu) == 5 | # ============================================================================== 6 | # 7 | # DESCRIPTION: 8 | # This script attempts to completely remove the Cursor application (installed 9 | # via AppImage or extraction) and its associated user configuration data. 10 | # It also resets the system's machine-id, which *may* help bypass trial 11 | # limitations based on this identifier. 12 | # 13 | # TARGET AUDIENCE: Users who need to perform a clean reinstall of Cursor. 14 | # 15 | # SYSTEM REQUIREMENTS: Debian/Ubuntu or derivative using systemd. 16 | # Requires bash, coreutils (rm, cat), systemd, sudo, apt. 17 | # 18 | # ============================================================================== 19 | # == WARNINGS & DISCLAIMER == 20 | # ============================================================================== 21 | # 22 | # 1. HIGHLY DESTRUCTIVE: This script uses 'rm -rf' which forcefully deletes 23 | # files and directories WITHOUT confirmation (beyond the initial script 24 | # confirmation). MISTAKES CAN LEAD TO DATA LOSS OR SYSTEM DAMAGE. 25 | # 2. DATA LOSS: All Cursor settings, cache, local history (if any not synced), 26 | # and related configuration WILL BE PERMANENTLY DELETED. Back up anything 27 | # important beforehand if needed. 28 | # 3. MACHINE ID RESET: Changing the machine ID is generally safe but *might* 29 | # affect other software relying on it (rare). A REBOOT IS REQUIRED. 30 | # 4. NO GUARANTEES: This script might not be sufficient to bypass all trial 31 | # mechanisms. Cursor could use other identifiers (MAC address, online 32 | # account, etc.). 33 | # 5. USE AT YOUR OWN RISK: The author(s) are NOT responsible for any damage 34 | # or data loss caused by using this script. REVIEW THE CODE CAREFULLY. 35 | # 6. ETHICAL USE: This script is provided for educational and testing purposes. 36 | # Please respect software licenses and terms of service. Consider 37 | # supporting developers by purchasing software you find valuable. 38 | # 39 | # ============================================================================== 40 | 41 | # --- Terminal Colors and Formatting --- 42 | RED='\033[0;31m' 43 | GREEN='\033[0;32m' 44 | YELLOW='\033[1;33m' 45 | BLUE='\033[0;34m' 46 | MAGENTA='\033[0;35m' 47 | CYAN='\033[0;36m' 48 | BOLD='\033[1m' 49 | DIM='\033[2m' 50 | NC='\033[0m' # No Color 51 | TICK="${GREEN}✓${NC}" 52 | CROSS="${RED}✗${NC}" 53 | INFO="${BLUE}ℹ${NC}" 54 | WARN="${YELLOW}⚠${NC}" 55 | 56 | # --- Spinner Animation --- 57 | spinner() { 58 | local pid=$1 59 | local delay=0.1 60 | local spinstr='|/-\' 61 | local msg="$2" 62 | printf "${DIM} %s" "$msg" 63 | while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do 64 | local temp=${spinstr#?} 65 | printf "\r ${CYAN}[%c]${NC} %s" "$spinstr" "$msg" 66 | local spinstr=$temp${spinstr%"$temp"} 67 | sleep $delay 68 | done 69 | printf "\r ${TICK} %s\n" "$msg" 70 | } 71 | 72 | # --- Progress Bar --- 73 | progress_bar() { 74 | local duration=$1 75 | local msg="$2" 76 | local width=40 77 | local progress=0 78 | local fill 79 | local remain 80 | 81 | echo -ne "\n ${msg}\n " 82 | while [ $progress -le 100 ]; do 83 | let fill=($width*$progress/100) 84 | let remain=$width-$fill 85 | printf "\r ${CYAN}[${NC}" 86 | printf "%${fill}s" '' | tr ' ' '█' 87 | printf "%${remain}s" '' | tr ' ' '░' 88 | printf "${CYAN}]${NC} ${progress}%%" 89 | progress=$((progress + 2)) 90 | sleep $(echo "scale=3; $duration/50" | bc) 91 | done 92 | echo -e "\n" 93 | } 94 | 95 | # --- Fancy Print Functions --- 96 | print_header() { 97 | clear 98 | echo -e "\n${CYAN}════════════════════════════════════════════════════════════════════${NC}" 99 | echo -e "${BOLD}${BLUE} Cursor Cleaner & Machine ID Reset Script${NC}" 100 | echo -e "${CYAN}════════════════════════════════════════════════════════════════════${NC}\n" 101 | } 102 | 103 | print_section() { 104 | echo -e "\n${MAGENTA}▓▒░ ${BOLD}$1${NC} ${MAGENTA}░▒▓${NC}" 105 | echo -e "${DIM}${MAGENTA}──────────────────────────────────────────${NC}\n" 106 | } 107 | 108 | print_warning() { 109 | echo -e " ${WARN} ${YELLOW}$1${NC}" 110 | } 111 | 112 | print_info() { 113 | echo -e " ${INFO} ${BLUE}$1${NC}" 114 | } 115 | 116 | print_success() { 117 | echo -e " ${TICK} ${GREEN}$1${NC}" 118 | } 119 | 120 | print_error() { 121 | echo -e " ${CROSS} ${RED}$1${NC}" >&2 122 | } 123 | 124 | # --- Configuration (Users might need to adjust these) --- 125 | # Default Downloads directory (Common on English systems, change if different) 126 | DOWNLOADS_DIR="$HOME/Downloads" 127 | # French Downloads directory (Uncomment below and comment above if needed) 128 | # DOWNLOADS_DIR="$HOME/Téléchargements" 129 | 130 | APPIMAGE_PATTERN="Cursor-*.AppImage" # Wildcard pattern for the AppImage file 131 | EXTRACTED_DIR="$HOME/squashfs-root" # Default extraction dir for AppImages mounted by the system 132 | 133 | # --- Function for running commands with sudo --- 134 | run_sudo() { 135 | echo -e " ${INFO} Running: ${CYAN}$@${NC}" 136 | if ! sudo "$@"; then 137 | print_error "Failed to execute sudo command: '$@'" 138 | fi 139 | } 140 | 141 | # --- Initial Checks and Confirmation --- 142 | print_header 143 | 144 | # Display warnings 145 | print_section "IMPORTANT WARNINGS" 146 | print_warning "This script performs destructive operations that cannot be undone!" 147 | print_warning "All Cursor settings and data will be permanently deleted." 148 | print_warning "A system reboot will be required after completion." 149 | echo 150 | 151 | # Display actions 152 | print_section "ACTIONS TO BE PERFORMED" 153 | print_info "1. Stop running Cursor processes" 154 | print_info "2. Remove Cursor AppImage files" 155 | print_info "3. Delete configuration data" 156 | print_info "4. Clean up system files" 157 | print_info "5. Reset machine ID" 158 | print_info "6. Update system databases" 159 | echo 160 | 161 | # Get confirmation 162 | echo -e "${YELLOW}${BOLD}Do you understand and accept the risks?${NC}" 163 | read -p "Type 'YES' in uppercase to confirm: " CONFIRMATION 164 | if [[ "$CONFIRMATION" != "YES" ]]; then 165 | print_error "Operation cancelled by user" 166 | exit 1 167 | fi 168 | 169 | # --- Main Operations --- 170 | print_section "STARTING CLEANUP PROCESS" 171 | 172 | # Stop Cursor Process 173 | print_info "Stopping Cursor processes..." 174 | killall cursor 2>/dev/null & 175 | spinner $! "Terminating running instances" 176 | 177 | # Remove Application Files 178 | print_info "Removing application files..." 179 | (find "$DOWNLOADS_DIR" -maxdepth 1 -name "$APPIMAGE_PATTERN" -print -delete) & 180 | spinner $! "Cleaning AppImage files" 181 | 182 | if [ -d "$EXTRACTED_DIR" ]; then 183 | (rm -rf "$EXTRACTED_DIR") & 184 | spinner $! "Removing extracted directory" 185 | fi 186 | 187 | # Remove User Config/Data with progress simulation 188 | print_section "CLEANING USER DATA" 189 | CONFIG_DIRS=( 190 | "$HOME/.config/Cursor" 191 | "$HOME/.cache/Cursor" 192 | "$HOME/.local/share/Cursor" 193 | "$HOME/.cursor" 194 | "$HOME/.cursor-server" 195 | ) 196 | 197 | progress_bar 3 "Removing configuration directories..." 198 | for dir in "${CONFIG_DIRS[@]}"; do 199 | if [ -e "$dir" ]; then 200 | rm -rf "$dir" 201 | print_success "Removed $dir" 202 | else 203 | print_info "Skipped $dir (not found)" 204 | fi 205 | done 206 | 207 | # Desktop/Icon Cleanup 208 | print_section "CLEANING SYSTEM FILES" 209 | progress_bar 2 "Removing desktop entries and icons..." 210 | 211 | # User files 212 | rm -f ~/.local/share/applications/cursor*.desktop 213 | rm -f ~/.local/share/applications/co.anysphere.cursor*.desktop 214 | rm -f ~/.local/share/icons/cursor*.* 215 | rm -f ~/.local/share/icons/co.anysphere.cursor*.* 216 | 217 | # System files 218 | run_sudo rm -f /usr/share/applications/cursor*.desktop 219 | run_sudo rm -f /usr/share/applications/co.anysphere.cursor*.desktop 220 | run_sudo rm -f /usr/share/icons/hicolor/*/apps/cursor.png 221 | run_sudo rm -f /usr/share/icons/hicolor/*/apps/co.anysphere.cursor.* 222 | run_sudo rm -f /usr/share/pixmaps/cursor*.* 223 | run_sudo rm -f /usr/share/pixmaps/co.anysphere.cursor.* 224 | 225 | print_info "Updating desktop database..." 226 | run_sudo update-desktop-database ~/.local/share/applications 227 | run_sudo update-desktop-database /usr/share/applications 228 | 229 | # Reset Machine ID 230 | print_section "RESETTING SYSTEM IDENTITY" 231 | progress_bar 2 "Resetting machine ID..." 232 | run_sudo rm -f /etc/machine-id 233 | run_sudo rm -f /var/lib/dbus/machine-id 234 | run_sudo systemd-machine-id-setup 235 | 236 | # Show new machine ID 237 | echo -e "\n${CYAN}New Machine ID:${NC}" 238 | sudo cat /etc/machine-id || print_error "Could not read new machine ID" 239 | 240 | # Final Cleanup 241 | print_section "FINAL CLEANUP" 242 | progress_bar 2 "Cleaning system caches..." 243 | run_sudo apt clean 244 | run_sudo updatedb 245 | 246 | # Final Instructions 247 | echo -e "\n${CYAN}════════════════════════════════════════════════════════════════════${NC}" 248 | echo -e "${GREEN}${BOLD} ✨ CLEANUP COMPLETE! ✨${NC}" 249 | echo -e "${CYAN}════════════════════════════════════════════════════════════════════${NC}\n" 250 | 251 | print_warning "A SYSTEM REBOOT IS REQUIRED TO COMPLETE THE PROCESS" 252 | echo -e "\n${BOLD}Would you like to reboot now? ${NC}(y/N): " 253 | read -n 1 -r 254 | echo 255 | if [[ $REPLY =~ ^[Yy]$ ]]; then 256 | echo -e "\n${YELLOW}System will reboot in 5 seconds...${NC}" 257 | sleep 5 258 | sudo reboot 259 | else 260 | print_info "Please remember to reboot your system manually" 261 | print_info "You can reboot using: ${CYAN}sudo reboot${NC}" 262 | fi 263 | 264 | exit 0 --------------------------------------------------------------------------------