Using xdg-settings w/ a snapped desktop file

Hi there… when using a command like xdg-settings set default-web-browser chromium.desktop to try and set your default web browser (minimal system with i3 in this case) on a system that uses a snapped version of a browser - this doesn’t work. You can symlink it and it will then work then (but have duplicate entries).

Anyone else run into this?

Hey @bashfulrobot, thanks for your question. The TL;DR answer is: we are working on it :slight_smile:

The slightly longer answer is that snaps run inside the core (or a base) snap. There they don’t have access to the systems xdg-settings to manipulate the settings. We also want to mediate this access to avoid snaps doing things behind the users back. Because of this the core snap ships with a version of xdg-settings that sends a dbus call to the host system from inside the confinement. The snap userd that runs as part of the users session can then pick up setting changes and ensure that they are sensible (and ask for confirmation if needed). This mediation mechanism is implemented in PR#4073 and we target that feature for snapd 2.31 in stable (should be in edge much sooner :slight_smile:

Sounds good. To keep my OCD brain from looking at double entries, I just duplicated the desktop file and gave it a different name of www.desktop