Feature request: allow snaps to register new mime types

Bug #1849094 reported by Olivier Tilloy on 2019-10-21
This bug affects 4 people
Affects Status Importance Assigned to Milestone

Bug Description

(originally posted at https://forum.snapcraft.io/t/allow-snaps-to-register-new-mime-types/6467)

snapd, when installing a snap, has some logic to parse desktop files and generate a mimeinfo.cache file that associates mime types to desktop files.

This allows e.g. a snapped app to advertise that it handles the application/x-foobarbaz mime type.

However there doesn’t seem to be a way for the snap to register application/x-foobarbaz as a new mime type (according to the shared-mime-info spec¹) so that it is recognized by the host system.

This would require invoking update-mime-database on a directory containing xml descriptions².

I think it would be interesting to add this functionality to snapd.

¹ https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/
² https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-0.18.html#idm140001680036896

I agree, I suppose that would be enough adding the ability to define packages in the form x-snap-foo.xml, indeed there could be clashing issues though.

So there should be for the user a way to avoid this if something is breaking its setup.

Changed in snapd:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers