# Maintainer: Menghuan1918 <menghuan2003 at outlook dot com> # Contributor: TimeTrap <zhaoyuanpan at gmail dot com> # Contributor: Jingu <xiuluo dot android at gmail dot com> # Contributor: Usama <eruzzamma at gmail dot com> pkgname=cursor-appimage-fix _pkgname=cursor pkgver=0.42.4 pkgrel=1 pkgdesc="Write, edit, and chat about your code with GPT. (AppImage)" arch=('x86_64') url="https://cursor.so" license=('custom') options=('!strip''!debug') depends=('hicolor-icon-theme''zlib''fuse2')
# Use curl to get the filename and extract the version # pkgver=$(curl -s -o /dev/null -D - -r 0-0 https://download.cursor.sh/linux/appImage/x64 | grep -o -E 'filename=.*$' | sed -e 's/.*cursor-\(.*\)\(.*\)\.AppImage.*/\1\.\2/')
# Apply the fix by replacing all occurrences of ",minHeight" with ",frame:false,minHeight" local target_file="${srcdir}/squashfs-root/resources/app/out/vs/code/electron-main/main.js" sed -i 's/,minHeight/,frame:false,minHeight/g'"$target_file"
# Modify the original desktop file sed 's/AppRun/\/opt\/appimages\/Cursor.AppImage/g' -i "${srcdir}/squashfs-root/cursor.desktop" sed 's/Exec=\/opt\/appimages\/Cursor.AppImage/Exec=\/opt\/appimages\/cursor.AppImage/g' -i "${srcdir}/squashfs-root/cursor.desktop" sed 's/StartupWMClass=Cursor/StartupWMClass=cursor/g' -i "${srcdir}/squashfs-root/cursor.desktop"
# Create a copy of the desktop file for Wayland cp"${srcdir}/squashfs-root/cursor.desktop""${srcdir}/squashfs-root/cursor-wayland.desktop" sed -i 's/^Name=Cursor/Name=Cursor (Wayland)/'"${srcdir}/squashfs-root/cursor-wayland.desktop" sed -i 's|Exec=/opt/appimages/cursor.AppImage|Exec=/opt/appimages/cursor.AppImage --enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --ozone-platform=wayland --disable-features=WaylandFractionalScaleV1|'"${srcdir}/squashfs-root/cursor-wayland.desktop" }