Files

From Things and Stuff Wiki
Revision as of 00:02, 14 March 2020 by Milk (talk | contribs) (Created page with "{{menu}} === File types === * https://en.wikipedia.org/wiki/Media_type - formerly known as '''MIME type''' is a two-part identifier for file formats and format contents trans...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


File types

  • https://en.wikipedia.org/wiki/Media_type - formerly known as MIME type is a two-part identifier for file formats and format contents transmitted on the Internet. The Internet Assigned Numbers Authority (IANA) is the official authority for the standardization and publication of these classifications. Media types were originally defined in Request for Comments 2045 in November 1996 as a part of MIME (Multipurpose Internet Mail Extensions) specification, for denoting type of email message content and attachments; hence the original name, MIME type. Media types are also used by other internet protocols such as HTTP and document file formats such as HTML, for similar purpose.


  • https://wiki.archlinux.org/index.php/Default_Applications - Programs implement default application associations in different ways, while command-line programs traditionally use environment variables, graphical applications tend to use XDG MIME Applications through either the GIO API, the Qt API or by executing /usr/bin/xdg-open, which is part of xdg-utils. Because xdg-open and XDG MIME Applications are quite complex various alternative resource openers were developed. These alternatives replace /usr/bin/xdg-open, which obviously only affects applications that actually use the executable. The following table lists some example applications for each method.
  • https://en.wikipedia.org/wiki/File_association - associates a file with an application capable of opening that file. More commonly, a file association associates a class of files (usually determined by their filename extension, such as .txt) with a corresponding application (such as a text editor).


  • https://github.com/mime-types/mime-types-data - provides a registry for information about MIME media type definitions. It can be used with the Ruby mime-types library or other software to determine defined filename extensions for MIME types, or to use filename extensions to look up the likely MIME type definitions.


  • desktop-entry-spec - The desktop entry specification describes desktop entries: files describing information about an application such as the name, icon, and description. These files are used for application launchers and for creating menus of applications that can be launched.


Configuration files:

/usr/share/applications/defaults.list
  # global
~/.local/share/applications/defaults.list
  # per user, overrides global

~/.local/share/applications/mimeapps.list

~/.local/share/applications/mimeinfo.cache


[Default Applications]
mimetype=desktopfile1;desktopfile2;...;desktopfileN


CLI

xdg-mime default Thunar.desktop inode/directory
  # make Thunar the default file-browser

xdg-mime default xpdf.desktop application/pdf
  # make xpdf the default PDF viewer


xdg-settings get default-web-browser
  # returns what app opens http/https



/usr/bin/vendor_perl/mimeopen -d $file.pdf


  • xdg-settings - get and set various desktop environment settings



  • mimeo - uses MIME-type file associations to determine which application should be used to open a file. It can launch files or print information such as the command that it would use, the detected MIME-type, etc. It is also possible to use regular expressions to associate arguments with applications. The most common example is to open URLs in browsers or associate file extensions with applications irrespective of their MIME-type.Mimeo tries to adhere to the relevant standards on freedesktop.org and should therefore be compatible with other applications that set or read MIME-type associations, e.g. PCManFM.


GUI


 kcmshell5 filetypes