Choosing the default application to open files in Zorin

It would be very nice to have the option to select the default application to open files in the Open With menu.
In Windows, there is a similar feature where the user can quickly choose what application opens a file format from now on.
image

Currently, to select the default application first the user must open the properties menu and then open the Open With tab to select the default application.
image

Adding a Set as default button to the Open with menu (shown above) speeds up and simplifies the process and more importantly, removes confusion.
For example, when I wanted to select the default app to open PDF files with, I thought I should go to the Default applications option in the Settings app to find the option to change it there.

3 Likes

Thunar file manager, which I sometimes use on XFCE has that option.

I normally use Nemo file manager, which is a fork of Nautilus- and it has the same "Open With Other Application" pop-up window that Nautilus has.

EDIT: Screenshot is of Nautilus File Manager.

2 Likes

Yes but where does it lit you associate that file extension with that other application so you do not have to do this every time. In zorin os 16 the only place I can find it is if you right click and select file properties and then select the open with tab...this will allow you to change the association and it works from there on out with other files of that type but for some reason it still shows the icon from the previous associated application.

1 Like

The icon of the file itself is the mimetype for that file; which application you choose to open it with will not change the mimetype icon.

Thank you. Is it easy to change the mime type or is that just something to live with. Thanks, Trey

It may be more productive if you can please outline exactly what it is you are trying to do.
Is that that you dislike one particular icon? That icon looks too similar to a different apps icon?
It may be a simple thing to correct, but would need to know what correction is needed first.

Yes, I'm resurrecting a 2 year-old thread - and I apologize. But I consider it so close to my issue - as to benefit others in future searching - that it's worth doing IMO.

@Aravisian asked:

please outline exactly what it is you are trying to do.

Lets use the VS Code (Codium) app as an example. It produces workspace text/json files with the extension ".code-workspace"

I would like to open these files with the app every time. But because the OS sees it as a "plain text document", it will then try to open ANY text file with the Codium app, including the ".txt" files that I still wanted to open with Text Editor.

The "open with" decision is made based on the file's TYPE, not the file's EXTENSION.

Where does one tweak the association to be based on the later?

You can check your ~/.config/mimeapps.list file.

Adjust as needed for the following mimetypes:

text/plain=org.gnome.gedit.desktop;

application/json=codium.desktop;
text/x-json=codium.desktop;

I set it to Gedit since that is the default text editor on Zorin OS Pro which your profile shows as your system.
For Zorin OS Lite or Lite Pro users, they can change that text/plain entry to mousepad. I use Xed as my default text editor.

The codium file association should remain the same.

1 Like

The default /usr/share/applications/codium.desktop file created during installation also has a mime type specified for application/x-codium-workspace, which doesn't exist but you can create it separately. This can be done for any file association that you need.

  1. Create a new file with an XML extension in $HOME/.local/share/mime/packages/application-x-codium-workspace.xml with the following content:

     <?xml version="1.0" encoding="UTF-8"?>
     <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
       <mime-type type="application/x-codium-workspace">
             <comment>Code Workspace</comment>
             <icon name="application-x-codium-workspace"/>
             <glob-deleteall/>
             <glob pattern="*.codium-workspace"/>
         </mime-type>
     </mime-info>
    

    You can pick the actual name of the file and change the details inside. For example the glob pattern I'm using *.codium-workspace instead of *.code-workspace, simply because that seems to be the default used in the .desktop file as mentioned earlier.

  2. Update the local mime type database by running:

    update-mime-database $HOME/.local/share/mime
    
  3. You may also need to edit the original .desktop file to rearrange the order of mime types, moving "application/x-codium-workspace" in front.

    - MimeType=text/plain;inode/directory;application/x-codium-workspace;
    + MimeType=application/x-codium-workspace;text/plain;inode/directory;
    

For reference:

https://wiki.archlinux.org/title/XDG_MIME_Applications

1 Like