Tomas_IV wrote: ⤴Tue Apr 17, 2018 1:24 pmCode: Select all
~/.config/mimeapps.list
~/.local/share/applications/mimeapps.list
/etc/linuxmint/adjustments/15-gnome-mimetypes.overwrite
/usr/share/applications/defaults.list
I can not find, where Engrampa is set to handle any document type, so how comes it appears in document opening options and is even a system-wide default (in absence of libreoffice from repsitory)? I suppopse there must be other mimeapps/defaults list I am missing.
Thanks for any hint.
As you've discovered, the "freedesktop.org" implementation of "mime" is a convoluted mess with files all over the place (more than you've found!) and a super-complicated way to perform a very simple task: associate program(s) with a file extension.
There's another whole mess in
/usr/share/mime/
(that's where the dumb file-browser display names are set)
Anyway, set custom stuff in
Each entry looks like:
Code: Select all
audio/mpeg=foobar.desktop;
video/mp4=smplayer.desktop;vlc.desktop;smplayer_enqueue.desktop;foobar.desktop;xplayer.desktop;
Most or many - but not all! - of the entries are in TWO places in that file, once under
[Added Associations]
and again under
[Default Applications]
. Some of my custom settings are under one, some under the other, some under both. Go figger.
I think you can copy that .config/mimeapps.list file to each user and they'll be all set.
Edit:
Notice that in the file .config/mimeapps.list there's an extra level of confusion. But of course!
For a .bmp file, the entry is:
image/x-win-bitmap=iview.desktop;
; IOW, you have to find the SPECIAL FREEDESKTOP.ORG name for your file extension!
So for a .odc file, you can't just put ".odc" there along with the program name to open it.
So you look in
/usr/share/mime/packages/freedesktop.org.xml
and find that ODC is a
<mime-type type="application/vnd.oasis.opendocument.chart">
and that's the BS you put in .config/mimeapps.list:
Code: Select all
application/vnd.oasis.opendocument.chart=leafpad.desktop
(I wrote that one, didn't copy it, so be careful).
Edit2:
Another fun feature is if you use one program to open more than one file type, it makes a .desktop file for each file type, all with the same content but a different file name, like
Code: Select all
userapp-iview-OAKJHZ.desktop
userapp-iview-VLM6FZ.desktop
Since the content is the same, you can delete all but one and rename it to
iview.desktop
and fix config/mimeapps.list so it matches the simple, informative name. (you DON'T need to do this though)
The .desktop files are in yet ANOTHER LOCATION!
~/.local/share/applications/iview.desktop
, etc.
Edit3: Here are the system files (plus your user files!) that define a(n) ODF file:
Code: Select all
$ pwd
/usr/share/mime
$ grep -iRl ODF *
application/vnd.oasis.opendocument.formula.xml
application/vnd.oasis.opendocument.formula-template.xml
globs
globs2
packages/freedesktop.org.xml
Pretty sweet, huh?
Edit4:
I can not find, where Engrampa is set to handle any document type,
Don't feel bad - I can't find where "gimp" is set as the default to open .xcf files (xcf is defined in 8 different files under /usr/share/mime)