Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exec must be without quotes in app.desktop file #2759

Closed
532910 opened this issue Mar 30, 2018 · 6 comments
Closed

Exec must be without quotes in app.desktop file #2759

532910 opened this issue Mar 30, 2018 · 6 comments

Comments

@532910
Copy link

532910 commented Mar 30, 2018

I'm using riot-web from https://riot.im/packages/debian
It's impossible to run it from menu, as Exec="/opt/Riot/riot-web"
Must be without quotes: Exec=/opt/Riot/riot-web

@t3chguy in element-hq/element-web#6421 says it's your issue

@532910 532910 changed the title Exec must be without quotes in riot-web.desktop Exec must be without quotes in app.desktop file Mar 30, 2018
@trevj
Copy link

trevj commented Feb 14, 2019

FYI, this breaks setAsDefaultProtocolClient on Linux, at least with AppImage:
https://electronjs.org/docs/api/app#appsetasdefaultprotocolclientprotocol-path-args

The reason is that xdg-settings cannot handle .desktop files with double quotes in the Exec line. Weird, though I think it's legal:
https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables

I put together a minimal app to reproduce:
https://github.com/trevj/setasdefaultprotocolclient-repro

How to run...

  • Build:
    • git clone the repo
    • cd to the repo's root
    • yarn install
    • yarn package
  • Run:
    • add some temp folder to your path, e.g. mkdir ~/tmp && export PATH=~/tmp:$PATH
    • copy the AppImage here, e.g. cp <path to repo>/dist/*.AppImage ~/tmp/
    • from a terminal, run the app and say yes to "integrate with the system"
    • there will be an error on the terminal: a protocol handler could not be added
    • edit the app's .desktop file (usually ~/.local/share/applications/appimagekit-setasdefaultprotocolclient-repro.desktop) and remove the double quotes from the Exec= line
    • run the app again - this time, there should be a message on the terminal confirming that a protocol handler was set
    • try to open a URL with this custom protocol, e.g. xdg-open setasdefaultprotocolclient-repro://bob - after a moment, a "hello!" message should appear on the terminal

That's a lot of steps to reproduce...are you open to a one-liner pull request? :-)

@eigenform
Copy link

It seems like xdg-mime doesn't like double-quotes - this apparently happens with our AppImage also.

@JonnyHaystack
Copy link

I've opened an issue with xdg-utils because it seems like this behaviour is bugged on that end https://gitlab.freedesktop.org/xdg/xdg-utils/issues/151

@develar
Copy link
Member

develar commented Jun 24, 2019

Well, without double quotes, desktop file will be invalid, because spaces must be escaped.

So, if this issue is important for you, consider using snap — it is the most recommended and user-friendly Linix packaging format (as I can say). (also, consider to distribute using snap store, and not via manual downloading).

@develar develar closed this as completed Jun 24, 2019
@develar develar added the linux label Jun 24, 2019
@develar develar reopened this Jun 24, 2019
@develar develar added the bug label Jun 24, 2019
@develar
Copy link
Member

develar commented Jun 24, 2019

Fixed in 21.0.1

@532910
Copy link
Author

532910 commented Nov 19, 2019

I confirm it's fixed and works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants