MIME type detection and default application lookup based on file extensions and XDG desktop entries.
| Name | Signature |
|---|---|
mime_type | mime_type(filename) -> mime |
mime_default_app | mime_default_app(m_type) -> app |
mime_info | mime_info(filename) -> info |
mime_type(
filename) ->mime
Detect the MIME type of a file based on its extension
mime_default_app(
m_type) ->app
Find the default application for a MIME type
Searches XDG mimeapps.list files for the default .desktop entry associated with the given MIME type. Checks user, local, system, and XDG config locations in order of priority.
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).