UPDATE-DESKTOP-DATABASE(1)

โœจ NAME โœจ

okay so bestie, update-desktop-database โ€” it builds a cache database of MIME types handled by desktop files. that's the whole vibe ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

update-desktop-database [-q|--quiet] [-v|--verbose] [DIRECTORY...]

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so update-desktop-database is the little tool that builds a cache database of the MIME types handled by desktop files. it's giving "backend bestie doing the quiet work so everything else looks effortless" ๐Ÿซถ

what's actually in that cache database? two things, no cap:

  • the list of MIME types that can be handled by desktop files
  • and for each MIME type, the list of desktop files that can handle that MIME type

why do we care?? because it makes life so much easier for apps that need to find an app to open a document of a specific MIME type. without this, they'd have to parse all the desktop files existing on the system ๐Ÿ˜ญ with it, they just parse this cache database instead. iconic behaviour honestly.

if you don't pass any DIRECTORY as an argument, the desktop files that get processed are the ones installed in $XDG_DATA_DIRS/applications. default queen ๐Ÿ‘‘

and if you use both --quiet and --verbose at the same time?? then --verbose will be ignored. periodt. ๐Ÿ’€


โœจ OPTIONS โœจ

the following options are supported:

  • -q, --quiet โ€” do not display any information about processing and updating progress. silent mode, no thoughts head empty ๐Ÿคซ
  • -v, --verbose โ€” display more information about processing and updating progress. tell me EVERYTHING ๐Ÿ”ฅ

๐Ÿฆ‹ NOTES ๐Ÿฆ‹

if an invalid MIME type is met, it will be ignored and the creation of the cache database will continue. she does not stop for drama ๐Ÿ’…

the format of the cache database is a simple desktop entry format, with a MIME Cache group, containing one key per MIME type. the key name is the MIME type, and the key value is the list of desktop file that can handle this MIME type.

the order of the desktop files found for a MIME type is not significant. so an external mechanism must be used to determine what is the preferred desktop file for a MIME type. no ranking here, everyone's equal ๐ŸŽ€


๐ŸŒˆ EXAMPLE ๐ŸŒˆ

here's a simple example of a cache database:

[MIME Cache]
application/x-shellscript=gedit.desktop;
text/plain=gedit.desktop;gvim.desktop;
video/webm=totem.desktop;

this cache database is created with three desktop files, each containing a MimeType key:

gedit.desktop: MimeType=text/plain;application/x-shellscript;
gvim.desktop: MimeType=text/plain;
totem.desktop: MimeType=video/webm;

look at her go ๐Ÿงšโœจ


๐ŸŽ€ FILES ๐ŸŽ€

  • $XDG_DATA_DIRS/applications/mimeinfo.cache โ€” this file is the cache database created by update-desktop-database. the main character file, lowkey.

๐Ÿ™ˆ BUGS ๐Ÿ™ˆ

if you find bugs in the update-desktop-database program, please report these on https://bugs.freedesktop.org. tell them everything, they're listening ๐Ÿซถ


ok that's the whole page bestie, go forth and cache ๐Ÿ’œ

FREEDESKTOP.ORG made this one, and it's filed under UPDATE-DESKTOP-DATABASE(1) in the General Commands Manual โ€” so like, freedesktop dot org and the manual page name, that's the whole sign-off. mwah ๐Ÿ’‹โญ