onlook icon indicating copy to clipboard operation
onlook copied to clipboard

[bug] Syntax error on linux .desktop file

Open mrnfrancesco opened this issue 1 year ago • 5 comments

Describe the bug

I'm on arch linux based distribution. Once installed Onlook cannot be run from UI menu because of a syntax error in /usr/share/applications/onlook.desktop file which has the following content:

Please note the leading " at the end of the binary name

[Desktop Entry]
Name=Onlook
Exec=onlook" %U
Terminal=false
Type=Application
Icon=onlook
StartupWMClass=Onlook
Comment=The first-ever devtool for designers
Categories=Utility;

mrnfrancesco avatar Dec 26 '24 01:12 mrnfrancesco

Thanks for reporting. This may require setting better options in the linux target. Truthfully we don't really have the capacity to test on Linux atm.

https://github.com/onlook-dev/onlook/blob/main/apps/studio/electron-builder.json5#L37

Kitenite avatar Dec 30 '24 20:12 Kitenite

Hi, I can confirm that the leading " at the end of the file name is the issue.

Another quick win would be to add Keywords=design;utility;devtool;onlook;keywords;etc;etc; which enables quick finding Onlook from a search bar in most distros.

JonCastaway avatar Jan 09 '25 08:01 JonCastaway

Fixed in PR #1028. Added proper desktop file configuration in electron-builder.json5 to prevent syntax errors in the generated .desktop file.

@JonCastaway @mrnfrancesco could you see if this works? https://github.com/onlook-dev/onlook/pull/1028

Kitenite avatar Jan 12 '25 07:01 Kitenite

I got this error building studio app with bun run package:

$ electron-builder
  • electron-builder  version=25.1.8 os=6.11.11-1-MANJARO
  • loaded configuration  file=/tmp/onlook/apps/studio/electron-builder.json5
  • writing effective config  file=release/0.1.16/builder-effective-config.yaml
  • executing @electron/rebuild  electronVersion=33.2.1 arch=x64 buildFromSource=false appDir=./
  • installing native dependencies  arch=x64
  • completed installing native dependencies
  • packaging       platform=linux arch=x64 electron=33.2.1 appOutDir=release/0.1.16/linux-unpacked
  • building        target=AppImage arch=x64 file=release/0.1.16/Onlook-x86_64.AppImage
  • executing @electron/rebuild  electronVersion=33.2.1 arch=arm64 buildFromSource=false appDir=./
  • installing native dependencies  arch=arm64
  • completed installing native dependencies
  • packaging       platform=linux arch=arm64 electron=33.2.1 appOutDir=release/0.1.16/linux-arm64-unpacked
  • building        target=AppImage arch=arm64 file=release/0.1.16/Onlook-arm64.AppImage

  ⨯ Please specify executable name as linux.executableName instead of linux.desktop.Exec  failedTask=build stackTrace=Error: Please specify executable name as linux.executableName instead of linux.desktop.Exec

    at LinuxTargetHelper.computeDesktopEntry (/tmp/onlook/node_modules/app-builder-lib/src/targets/LinuxTargetHelper.ts:107:13)
    at Lazy.creator (/tmp/onlook/node_modules/app-builder-lib/src/targets/AppImageTarget.ts:29:21)
    at Lazy.get value [as value] (/tmp/onlook/node_modules/lazy-val/src/main.ts:18:25)
    at AppImageTarget.build (/tmp/onlook/node_modules/app-builder-lib/src/targets/AppImageTarget.ts:50:25)
    at async Promise.all (index 0)
    at AsyncTaskManager.awaitTasks (/tmp/onlook/node_modules/builder-util/src/asyncTaskManager.ts:65:25)
    at /tmp/onlook/node_modules/app-builder-lib/src/platformPackager.ts:152:7
error: script "package" exited with code 1

mrnfrancesco avatar Jan 12 '25 14:01 mrnfrancesco