[snap] doesn't properly save desktop files for "create shortcuts" action

Bug #1732482 reported by Ken VanDine on 2017-11-15
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Medium
Olivier Tilloy

Bug Description

For chrome apps, the create shortcuts action should create desktop files but it doesn't. I suspect it has something to do with paths.


tracking: candidate
installed: 62.0.3202.94 (123) 246MB -

Olivier Tilloy (osomon) wrote :

With logging enabled, when trying to create a shortcut I'm seeing this:

LaunchProcess: failed to execvp:
xdg-desktop-menu
LaunchProcess: failed to execvp:
xdg-desktop-menu
LaunchProcess: failed to execvp:
xdg-icon-resource
[21693:21829:1115/175326.882133:WARNING:shell_integration_linux.cc(319)] Could not install icon chrome-nbpndmhhdfecmpfahflnahbbdpihnadk-Default.png at size 32.
LaunchProcess: failed to execvp:
xdg-icon-resource
LaunchProcess: failed to execvp:
xdg-icon-resource
[21693:21831:1115/175326.885379:WARNING:shell_integration_linux.cc(319)] Could not install icon chrome-nbpndmhhdfecmpfahflnahbbdpihnadk-Default.png at size 32.
[21693:21829:1115/175326.887645:WARNING:shell_integration_linux.cc(319)] Could not install icon chrome-nbpndmhhdfecmpfahflnahbbdpihnadk-Default.png at size 48.
LaunchProcess: failed to execvp:
xdg-icon-resource
[21693:21831:1115/175326.891419:WARNING:shell_integration_linux.cc(319)] Could not install icon chrome-nbpndmhhdfecmpfahflnahbbdpihnadk-Default.png at size 48.
LaunchProcess: failed to execvp:
xdg-icon-resource
[21693:21829:1115/175326.894292:WARNING:shell_integration_linux.cc(319)] Could not install icon chrome-nbpndmhhdfecmpfahflnahbbdpihnadk-Default.png at size 128.
LaunchProcess: failed to execvp:
xdg-icon-resource
[21693:21831:1115/175326.896715:WARNING:shell_integration_linux.cc(319)] Could not install icon chrome-nbpndmhhdfecmpfahflnahbbdpihnadk-Default.png at size 128.
LaunchProcess: failed to execvp:
xdg-icon-resource
[21693:21829:1115/175326.906654:WARNING:shell_integration_linux.cc(319)] Could not install icon chrome-nbpndmhhdfecmpfahflnahbbdpihnadk-Default.png at size 256.
LaunchProcess: failed to execvp:
xdg-icon-resource
[21693:21831:1115/175326.908762:WARNING:shell_integration_linux.cc(319)] Could not install icon chrome-nbpndmhhdfecmpfahflnahbbdpihnadk-Default.png at size 256.
LaunchProcess: failed to execvp:
xdg-desktop-menu
LaunchProcess: failed to execvp:
xdg-desktop-menu

Changed in chromium-browser (Ubuntu):
status: New → Confirmed
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → Medium
Olivier Tilloy (osomon) wrote :

If I add usr/bin/xdg-desktop-menu and usr/bin/xdg-icon-resource to the snap, the errors go away, and indeed a desktop file is created in $HOME/snap/chromium/current/.local/share/applications/.

These desktop files are not marked executables, so double-clicking on them in nautilus won't work. After marking them executable, interestingly some of them work, and some don't (they just open an empty browser window with all its chrome).
An example of a shortcut that works is https://html5test.com. One that doesn't is https://example.org.

Olivier Tilloy (osomon) wrote :

And now the shortcut for https://example.org started working, mysteriously.

Olivier Tilloy (osomon) wrote :

Desktop files in $HOME/snap/chromium/current/.local/share/applications/ are not very useful on a classic desktop, as gnome-shell (or others DEs) won't find them there.
We could probably modify the xdg-desktop-menu script to write to a different location. But $HOME/.local/share/applications/ won't work, because the home plug doesn't allow reading/writing to dot folders.

Olivier Tilloy (osomon) wrote :

Appending $HOME/snap/chromium/current/.local/share to $XDG_DATA_DIRS allows gnome shell (and likely other DEs) to see the desktop files and to launch them using the chromium snap. Need to discuss how this can be approached with the snapd team.

Jonas (jonny-boy) wrote :

Any news on this? I am using chromium 66.0.3359.139 (283 stable snap) under Fedora.
The create shortcuts action created a .desktop file under ~/Desktop, which is not useful when using the Gnome shell.
The Exec part in the .desktop file points to /snap/chromium/283/usr/lib/chromium-browser/chromium-browser ...
which is not the right path for my installation. I replaced the path with /var/lib/snapd/snap/bin/chromium and the chrome app is now working after moving it to .local/share/applications manually.

Olivier Tilloy (osomon) wrote :

There's a discussion on the snapcraft forum at https://forum.snapcraft.io/t/how-to-expose-desktop-files-created-by-snaps-to-the-de/2853, but no recent input on it.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers