Feature request: allow snaps to register new mime types

Bug #1849094 reported by Olivier Tilloy
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Undecided
Unassigned

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

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

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
Revision history for this message
Jamie Strandboge (jdstrand) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.