2

I want to have a default application for (almost) all text/* mimetypes.

To affect nautilus I'm editing the .local/share/defaults.list.

Sadly, using something like text/x-*=vim.desktop, the entry is ignored.

Is there a way to use a wildcard in this list? Or is there a better way to do it?

2

Not sure it will help you but the following mime type list has helped me. I am still not sure that I am 100% right on this but so far this is working for me.

I was trying to develop a 'open with' script that takes any kind of file and sends to a script (think something like 'add this file to repo' regardless of its type). This is documented almost nowhere I have searched for answer (and documentation is all but comprehensive on these things)

It turns out that there are some MimeTypes that apply to wider range of file types. For example try this in your .desktop file.

MimeType=text/plain;binary/octet-stream;application/octet-stream;

Apparently application/octet-stream is base mime type from which others are derived.

Now do not rely on .local/share/defaults.list you'd likely need .desktop file in:

~/.local/share/applications/ - for your user and/or
/usr/local/share/applications/ - guess for all other users including you

if at first your app does not appear on your 'open with' list when you are clicking on a file, add it from deeper menus (shall add that file mime type)

also I find these posts very inspiring and important

Fixing mime type on Ubuntu

https://askubuntu.com/questions/162612/how-can-i-add-an-application-to-the-list-of-open-with-applications

I also realized that if you are using Nautilus file manager it is possible to enable viewing mime type next to file name in the file list. This needs to be enabled on the Nautilus view (need to make column visible - see preferences or right-click on the columns)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.