Created
          November 23, 2024 21:22 
        
      - 
      
- 
        Save DickyChant/85d18dc9f71202d18a48bcad2860dd7b to your computer and use it in GitHub Desktop. 
    Cursor helpers
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # ... Other .zshrc contents above | |
| function cursor() { | |
| /opt/cursor.appimage --no-sandbox "$@" >/dev/null 2>&1 & | |
| } | |
| # I used the default settings in the cursor install script here | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| installCursor() { | |
| if ! [ -f /opt/cursor.appimage ]; then | |
| echo "Installing Cursor AI IDE..." | |
| # URLs for Cursor AppImage and Icon | |
| CURSOR_URL="https://downloader.cursor.sh/linux/appImage/x64" | |
| ICON_URL="https://raw.githubusercontent.com/rahuljangirwork/copmany-logos/refs/heads/main/cursor.png" | |
| # Paths for installation | |
| APPIMAGE_PATH="/opt/cursor.appimage" | |
| ICON_PATH="/opt/cursor.png" | |
| DESKTOP_ENTRY_PATH="/usr/share/applications/cursor.desktop" | |
| # Install curl if not installed | |
| if ! command -v curl &> /dev/null; then | |
| echo "curl is not installed. Installing..." | |
| sudo apt-get update | |
| sudo apt-get install -y curl | |
| fi | |
| # Download Cursor AppImage | |
| echo "Downloading Cursor AppImage..." | |
| sudo curl -L $CURSOR_URL -o $APPIMAGE_PATH | |
| sudo chmod +x $APPIMAGE_PATH | |
| # Download Cursor icon | |
| echo "Downloading Cursor icon..." | |
| sudo curl -L $ICON_URL -o $ICON_PATH | |
| # Create a .desktop entry for Cursor | |
| echo "Creating .desktop entry for Cursor..." | |
| sudo bash -c "cat > $DESKTOP_ENTRY_PATH" <<EOL | |
| [Desktop Entry] | |
| Name=Cursor AI IDE | |
| Exec=sh -c \"$APPIMAGE_PATH --no-sandbox \" | |
| Icon=$ICON_PATH | |
| Type=Application | |
| Categories=Development; | |
| EOL | |
| echo "Cursor AI IDE installation complete. You can find it in your application menu." | |
| else | |
| echo "Cursor AI IDE is already installed." | |
| fi | |
| } | |
| installCursor | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment