Skip to content

Instantly share code, notes, and snippets.

@muhrifqii
Last active July 2, 2025 10:42
Show Gist options
  • Save muhrifqii/83a0775b361ea7829bfb49c57641795f to your computer and use it in GitHub Desktop.
Save muhrifqii/83a0775b361ea7829bfb49c57641795f to your computer and use it in GitHub Desktop.
cursor updater linux
[Desktop Entry]
Name=Cursor App
Type=Application
Categories=Utility;Development;
Exec=sh -c '/{HOME PATH HERE}/Applications/cursor/cursor.AppImage --no-sandbox; $SHELL'
Icon=/{HOME PATH HERE}/Applications/cursor/cursor.jpg
#!/bin/bash
APPDIR=$HOME/Applications/cursor
VERSION_FILE=$APPDIR/.version
# Create version file if it doesn't exist
if [ ! -f "$VERSION_FILE" ]; then
echo "No version file found. Creating one..."
echo "0.0.0" > "$VERSION_FILE"
fi
# Read current version
CURRENT_VERSION=$(cat "$VERSION_FILE")
echo "Current version: $CURRENT_VERSION"
# Get latest version information
response=$(curl -s 'https://cursor.com/api/download?platform=linux-x64&releaseTrack=stable')
URL=$(echo "$response" | jq -r '.downloadUrl')
VER=$(echo "$response" | jq -r '.version')
echo "Latest version: $VER"
# Check if we need to update
if [ "$CURRENT_VERSION" = "$VER" ]; then
echo "Already at the latest version ($VER). Skipping download."
else
echo "Updating from $CURRENT_VERSION to $VER..."
wget -O $APPDIR/cursor.AppImage $URL
if [ $? -eq 0 ]; then
chmod +x $APPDIR/cursor.AppImage
echo "$VER" > "$VERSION_FILE"
echo "Update completed successfully."
else
echo "Download failed. Keeping current version."
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment