std.mime.mime_info

std.mime

mime_info(filename) -> info

Get MIME type, default application, and command line for a file

Returns a table with fields: type (MIME type string), default_app (.desktop filename), cmdline (Exec line from the .desktop file, or "xdg-open" as fallback).