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

.desktop file Exec escaping not working anymore #175

Closed
Hornobster opened this issue Aug 4, 2024 · 4 comments
Closed

.desktop file Exec escaping not working anymore #175

Hornobster opened this issue Aug 4, 2024 · 4 comments

Comments

@Hornobster
Copy link

I have this .desktop file for a specific Brave profile:

[Desktop Entry]
Version=1.0
Name=Brave 4BMC
StartupNotify=true
StartupWMClass=brave-browser-4bmc
TryExec=brave
Exec=brave --profile-directory=\"Profile 1\" --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto %U
Terminal=false
Icon=brave
Type=Application
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml_xml;image/webp;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;

Since last release I am getting an error when launching j4-dmenu-desktop:

$ j4-dmenu-desktop --dmenu="bemenu -H22 -i" --no-exec

[2024-08-04 18:31:23.846] [error] [Application.cc:128] /home/user/.local/share/applications/brave-browser-4bmc.desktop: Exec: Tried to interpret invalid escape sequence \".

terminate called after throwing an instance of 'escape_error'
  what():  Exec: Tried to interpret invalid escape sequence \".
Aborted (core dumped)

I have solved this with:

Exec=brave --profile-directory='"Profile 1"' --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto %U

I'm writing this issue because I haven't seen anything related to this change in the release notes.

@meator
Copy link
Collaborator

meator commented Aug 4, 2024

Your original desktop file is not conformant to the Desktop entry specification (namely the quoting Exec part). j4-dmenu-desktop cannot promise support for desktop files which do not adhere to the spec. A conformant Exec key would look something like this:

Exec=brave "--profile-directory=Profile 1" --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto %U

Even though I don't consider this a "breaking change", I will update the release notes of r3.1 to warn users about using nonconformant desktop files, because version r3.1 introduces a more strict handling of desktop files.

I will update the GitHub release description, but I don't think it's necessary to update the CHANGELOG (but I'm open to discussion).

@Hornobster
Copy link
Author

Hornobster commented Aug 4, 2024

Unfortunately that doesn't work, but maybe it's because I pass the output to swaymsg?

In my sway config I have:

set $menu j4-dmenu-desktop --dmenu="bemenu -H22 -i" --no-exec | xargs swaymsg exec --

Is my solution above conformant to the spec?

EDIT: yes, I can confirm that your Exec works without --no-exec | xargs swaymsg exec --

@meator
Copy link
Collaborator

meator commented Aug 4, 2024

j4-dmenu-desktop has support for Sway. Try running

j4-dmenu-desktop <args> --i3-ipc

@Hornobster
Copy link
Author

Thank you, that works.

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

No branches or pull requests

2 participants