Default Application Associations

2024-09-17
Forward links: related:MIME related:Linux Backward links:

XDG and friends

According to (ArchWiki 2011) and (ArchWiki 2018):

xdg-utils provides the standard XDG MIME Application configurations, importantly

  • user-specific overrides are saved at /home/user/.config/mimeapps.list
  • xdg-open would open the file with the associated application as configured, in a blocking way
  • for example XDG_UTILS_DEBUG_LEVEL=10 xdg-mime query default text/html queries what application is associated with text/html, and display the order how xdg-open looks for the application
  • xdg-settings as far as I can tell modify /home/user/.config/mimeapps.list, and its scope is limited, see xdg-settings --list.
  • xdg-mime default feh.desktop image/jpeg also modify /home/user/.config/mimeapps.list.

I prefer to modify the overrides file directly.

Reference

ArchWiki. 2011. “Xdg Mime Applications.” 2011. https://wiki.archlinux.org/title/XDG_MIME_Applications.
———. 2018. “Xdg-Utils.” 2018. https://wiki.archlinux.org/title/Xdg-utils.