Changes

The following lines were added (+) and removed (-):
Linux Mint with the Cinnamon desktop has a utility to easily set what application opens as a default for each file type or file extension (extension does not exclusively determine file type as this is not MSDOS).  As an example the default graphical file manager for Cinnamon is Nemo.  This can be easily altered to an alternative by the user.Linux Mint with the Cinnamon desktop has a utility to easily set what application opens as a default for each file type or file extension (extension does not exclusively determine file type as this is not MSDOS).   * Preferred Applications - the Mint Cinnamon simple and basic graphical mine type management utility * gio - view mine type file associations from the shell and set the preferred application for each file typeSet the default environment file manager by: System Settings -> Preferred Applications -> (File Manager)  Typical users will find the Preferred Applications graphical utility will meet their needs.  However, it is both somewhat buggy and does not provide configuration for each file type.  It is really more like something Microsoft would do than what should be included in a Linux desktop environment.  You have the ability to use a more precision application mine type management using the gio command rather than the graphical Preferred Applications utility. As an example the default graphical file manager for Cinnamon is Nemo.  This can be easily altered to an alternative by the user using the Preferred Applications graphical utility. Set the default environment file manager by: System Settings -> '''Preferred Applications''' -> (File Manager)  You can observe all video mine type associations from the CLI. type: cat ~/.config/mimeapps.list |grep videoTo correct the mine type association for avi we can do the following.  First lets see how it is currently set.  This will show the default and recommended applications for opening avi video files: cat ~/.config/mimeapps.list |grep aviIf you have several multimedia players installed you might see a longer list, otherwise it may be shorter than this output example.  OUTPUT: video/avi=vlc.desktop video/x-avi=smplayer.desktop video/avi=vlc.desktop; video/x-avi=vlc.desktop; Our goal is to set so that avi defaults to open in smplayer for this example.  The following command will be executed: gio mime video/avi smplayer.desktopSolution Confirmed.  The avi files now open on smplayerWhat is '''gio'''?DESCRIPTION:  gio is a utility that makes many of the GIO features available from the commandline. In doing so, it provides commands that are similar to traditional utilities, but let you use GIO locations instead of local files: forexample you can use something like smb://server/resource/file.txt as a location.EXIT STATUS: On success 0 is returned, a non-zero failure code otherwise.GIO is a high level library that handles files: not just from the file system, but also abstractions like trash and virtual network mounts.  The gio command in Linux stands for GNOME I/O.  Besides changing mime type associations with software applications, the gio command is capable of many more things related to the GNOME Virtual File System.  CLI alternative to gio is '''xdg-mime'''.  According to some sources gio can be used for various file-related tasks, it's not the recommended tool for directly managing MIME type associations. xdg-mime is the standard tool for this purpose and is more widely recognized in the Linux ecosystem for handling file associations. $ xdg-mime query default video/avi smplayer.desktopRunning the command "$ xdg-mime query default video/avi" on the command line returns the output "smplayer.desktop"  If it were set to VLC, you could change it to SMPlayer using the command: xdg-mime default smplayer.desktop video/aviReview:Three different ways to set what application will open a specific file type in Linux Mint Cinnamon, one of which uses the desktop graphic environment and the other two using command line interface.* Preferred Applications * gio* xdg-mimeUsing Preferred Applications is not as precise and sometimes malfunctions.  Using gio gets the job done but may not be the best recommended technique and using xdg-mime also works and is less distribution or desktop manager specific. Each option will edit the ~/.config/mimeapps.list within the user's own home directory.  Although mimeapps.list could be edited manually using a text editor however this practice is discouraged due to very specific syntax required and bypasses error checking.  Depending on factors regarding your installation, which of these options works best for you is unknown, however, one of these options will work.
Bureaucrat, administrator
16,192
edits