Patrick, who has the Krita logo overlaid on him, and Man Ray have a back and forward pointing out that desktop files can have multiple file types associated with a programme by setting the mime type field. It ends with Man Ray insisting on Krita making one desktop file, but instead shows a list of desktop files with the format org.kde.krita.format.desktop.
you are viewing a single comment's thread
view the rest of the comments
[–] 41 points 5 months ago (4 children)

Anyone with any light to shed?

  • source
  • hideshow 4 child comments
  • [–] 72 points 5 months ago (2 children)

    .desktop files are essentially used similar to Windows' registry - you create such a metadata file in a specific location, and it acts as a launcher, autostart setup, and file type assignment (so you can easily assign e.g. PNG files to open with Krita by default).

    As the wiki says, you can put multiple MIME types (file type descriptor such as "text/plain" or "application/json" or "image/jpeg" and so on) onto one dotdesktop file, meaning you only need a single launcher to support all file types.

    Krita explicitly creates quite a few dotdesktop files, each supporting only a single MIME type.

    Downside: littered desktop.

    Upside: you can easily pick and choose which file types to open with Krita directly.

    Most desktop environments actually handle the [samename]. extension.desktop repetition so you'll only have one Krita launcher entry but it will still collate all MIME type support that is present. Want to exclude e.g. BMP files? Delete the .bmp.desktop file.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 6 points 5 months ago

    Please never delete application's .desktop files unless you created them yourself. It can confuse both you and your package manager. If you want some file type to never be opened by a program, override it's .desktop file in ~/.local/share/applications instead.

  • source
  • parent
  • [–] 15 points 5 months ago

    XDG Desktop files are a mostly standardized way to integrate individual programs into the desktop. For example, a desktop file in /usr/share/applications or ~/.local/share/applications can add programs to the application launcher, both desktop launcher menus and separate apps like dmenu-run; or they can be used to start applications when the desktop session starts by placing them in ~/.config/autostart.

    Desktop files can also set properties related to an application. In this particular case, the MimeType field tells the desktop session what MIME types should be associated with the application. For example, my desktop file for Blender associates the application/x-blender MIME type with it, which causes Blender to show up in the Open with... dialog.

    The MimeType field is a semicolon-separated list. One desktop file can define multiple associated MIME types for the same application. Krita instead creates a separate file for each association.

  • source
  • parent