chmln / handlr

A better xdg-utils
MIT License
609 stars 24 forks source link

Consider switching to xdg-mime #2

Closed ebassi closed 4 years ago

ebassi commented 4 years ago

The mime-db crate uses a hard-coded list of globs/MIME type mappings; the mime-sniffer crate uses its own list of magic matchers. This means that every time a new MIME type is added, both crates need to be updated, and thus any dependent crate or application needs to be updated as well.

Most modern Linux/Unix-like OSes provide on the shared-mime-info database for applications trying to match file data and file names to a MIME type; I've written the xdg-mime crate that implements the API to load and query that database. Since the database is externally updated, every user of xdg-mime will automatically be updated without requiring to be rebuilt.

Disclaimer: the xdg-mime crate API is still in somewhat in flux, but I'm happy to add new API to fit the requirements of applications like handlr. :wink:

chmln commented 4 years ago

Thats awesome @ebassi ! I have to say it looks quite compelling. Will take a look asap

asm0dey commented 4 years ago

@chmln you have typo on crae page: Documentation, not Dumentation