Skip to content

Instantly share code, notes, and snippets.

@arpagon
Created August 31, 2023 21:51
Show Gist options
  • Save arpagon/5fe19a2cdfe82ed138d4ba2689221db4 to your computer and use it in GitHub Desktop.
Save arpagon/5fe19a2cdfe82ed138d4ba2689221db4 to your computer and use it in GitHub Desktop.
Cursor-Desktop-AutoUpdate-Handler.sh
#!/bin/bash
# Step 1: Confirm the path to the .AppImage file
APPIMAGE_PATH="$HOME/Applications/cursor-0.8.6.AppImage"
echo "Using AppImage path: $APPIMAGE_PATH"
# Step 1.5: Download the Cursor logo
ICON_PATH="$HOME/.local/share/icons/cursor-icon.svg"
curl -o $ICON_PATH "https://www.cursor.so/brand/icon.svg"
echo "Downloaded logo to: $ICON_PATH"
# Step 2: Create a .desktop file with necessary fields
DESKTOP_FILE_CONTENT="[Desktop Entry]
Type=Application
Name=Cursor
Exec=$APPIMAGE_PATH
Icon=$ICON_PATH
Categories=Utility;
"
echo "Generating .desktop content"
# Step 3: Save the .desktop file
DESKTOP_FILE_PATH="$HOME/.local/share/applications/cursor.desktop"
echo "$DESKTOP_FILE_CONTENT" > $DESKTOP_FILE_PATH
echo "Saved .desktop file at: $DESKTOP_FILE_PATH"
# Step 4: Make it executable
chmod +x $DESKTOP_FILE_PATH
echo "Made the .desktop file executable"
# Done
echo "All set, Cursor should now be available in your app launcher with a fancy icon."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment