.desktop file location

Hi,

Here’s my snapcraft.yaml file and here’s the runtime error I’m getting:

Error org.freedesktop.DBus.Error.Failed: cannot find desktop file “/var/lib/snapd/desktop/applications/brave_brave-browser.desktop”

The file under /var/lib/snapd/desktop/applications is called brave_brave.desktop.

How do I fix it?

I read all the documentation I could find and experimented with different changes in snapcraft.yaml and nothing seems to work.

Thanks

You cannot change it. You need to change the desktop name in the browser code to use brave_brave.desktop. I have been looking into brave’s code recently, and it needs a lot of improvements. The chromium snap might help you guys.

https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/tree/

You could change the app name (line 16) in your snapcraft.yaml, that woukd then make you end up with brave_brave-browser … but people running brave from cmdline would then have to use brave.brave-browser to actually run it, so perhaps changing the source of brave as soumyadeep suggested might be more desirable…

Wouldn’t snapd then rename it again to brave-browser_brave-browser.desktop or does snapd renames it in this way $SNAP_NAME+app_name.desktop and all the examples have same name and app so, that’s how they all end up?

Yup, it is usually snapname_appname… you might have multiple gui apps in a snap so this way they can all have their own desktop file…

Having the app name identical to the snap name only has the benefit that you do not need to use the snap.app notation when running the app from the cli.

1 Like

Wish I could flag this as doc! But, if that’s the case, I think they can apply for an alias

Hi,

I’d treat changes in the browser as a last resort.

Changing the app name and setting up the alias seems like the simplest/cleanest option, but it doesn’t actually work. The app name change does the trick, but the alias can’t be set.

With the app name change, I’d also be concerned about updates on systems that already have the snap installed with a different app name - not sure if that’d break anything.

How would the thinnest possible “pass-through” app look like? Something that would just produce /var/lib/snapd/desktop/applications/brave_brave-browser.desktop and execute the other app? I tried putting that together, but I couldn’t find a way to make it work…

Thanks

As far as snapd is concerned, it will take each whatever.desktop file in $SNAP/meta/gui, and write a sanitised version as snapname_whatever.desktop. Presumably Snapcraft is renaming the desktop file for you to match the app name. I’m not sure how you’d turn that off.

I tested the application-side change and it works. I can’t say I’m happy about having to modify the browser, but it appears to be the least risky/impactful change to achieve the ability to set it as default.

Please consider improvements in this area - this should be doable without modifying the snapped applications.

TBH, brave browser has a lot of places to improve, like a lot. From wayland to pipewire, to GPUs. This is just an example, where your browser needs a change to fit into as a snap. This naming scheme is kind of a dns thing and implied on just like others do, by renaming it to org.example.brave.desktop.

Regarding my first lines on change, me and my friend today played the Googles cricket doodle game in both Brave and the Chromium snap. And guess what, Chromium snap is much much smoother. Disabling wayland, at this time, is really a big thing for the browser.

@soumyaDghosh your contributions would be most welcome!

Yup I’ll try my best. Currently don’t have the time due to exams coming up.

Hii… where can I start a discussion, with issues I am facing while enabling wayland and pipewire? I just added wayland and pipewire related deps and built the snap locally. It picks up the portal for screensharing correctly. But the call never connects. Probably this is the error log

Gtk-Message: 00:26:34.386: Not loading module "atk-bridge": The functionality is provided by GTK natively. Please try to not load it.

(brave:137832): Gtk-WARNING **: 00:26:34.452: GTK+ module /snap/brave/x8/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: 00:26:34.452: Failed to load module "canberra-gtk-module"

(brave:137832): Gtk-WARNING **: 00:26:34.454: GTK+ module /snap/brave/x8/gnome-platform/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so cannot be loaded.
GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported.
Gtk-Message: 00:26:34.454: Failed to load module "canberra-gtk-module"
[137832:137832:1111/002634.600601:ERROR:policy_logger.cc(157)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(163) Cloud management controller initialization aborted as CBCM is not enabled.
tracing_subscriber - init success
[1111/002635.017671:ERROR:ptracer.cc(604)] ptrace: Input/output error (5)
[1111/002635.093510:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[137832:137832:1111/002635.343970:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=139
[137832:137832:1111/002635.673909:ERROR:object_proxy.cc(577)] Failed to call method: org.freedesktop.ScreenSaver.GetActive: object_path= /org/freedesktop/ScreenSaver: org.freedesktop.DBus.Error.NotSupported: This method is not part of the idle inhibition specification: https://specifications.freedesktop.org/idle-inhibit-spec/latest/
[1111/002635.678934:ERROR:ptracer.cc(604)] ptrace: Input/output error (5)
[1111/002635.711634:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[137832:137832:1111/002635.818196:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=139
[1111/002636.127170:ERROR:ptracer.cc(604)] ptrace: Input/output error (5)
[1111/002636.158523:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[137832:137832:1111/002636.271975:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=139
[1111/002636.291371:ERROR:ptracer.cc(604)] ptrace: Input/output error (5)
[1111/002636.319473:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[137832:137832:1111/002636.443316:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=139
[1111/002636.459765:ERROR:ptracer.cc(604)] ptrace: Input/output error (5)
[1111/002636.487090:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[137832:137832:1111/002636.595781:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=139
[1111/002636.611569:ERROR:ptracer.cc(604)] ptrace: Input/output error (5)
[1111/002636.638374:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[137832:137832:1111/002636.745645:ERROR:gpu_process_host.cc(990)] GPU process exited unexpectedly: exit_code=139
[137940:41:1111/002822.708976:ERROR:sdp_offer_answer.cc(549)] The media section with MID='0' has a ssrc-group with semantics FID and an unexpected number of SSRCs. (INVALID_PARAMETER)
[137940:41:1111/002822.709090:ERROR:sdp_offer_answer.cc(946)] Failed to set remote answer sdp: The media section with MID='0' has a ssrc-group with semantics FID and an unexpected number of SSRCs.
[137940:42:1111/002829.749441:ERROR:dcsctp_transport.cc(234)] DcSctpTransport3->ResetStream(sid=0): Transport is not started.

As much I searched, the remote answer error with MID=0 is probably something issue in the core. Would like to discuss with you and others on this.

where can I start a discussion, with issues I am facing while enabling wayland and pipewire?

There’s a recent PR for Wayland at https://github.com/brave/brave-browser-snap/pull/32. We can discuss there.

Otherwise we can open an issue at https://github.com/brave/brave-browser/issues.