Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-05-17 17:59:38

Friedrich
Member
Registered: 2016-09-18
Posts: 60

Where gets Thunar the information about file association?

Hi,

when i right click to a file in thunar i have a default app and some other apps to open the file. On ubuntu 18.04 the only file the set up these apps was ~/.config/mimeapps.list. There was no other associations. Now on ubuntu 20.04 there must be something more because i see a lot of file association in the "open with" dialog. These application are not i the mimeapps.list. All other files i've found with google don't exists or empty. I have also nemo installed and nemo seems to use the mimeapps.list, but after there are other file association. So i think there must be something xfce specific where thunar reads this extra associations.

Friedrich

Offline

#2 2020-05-18 17:03:18

Clio
Member
Registered: 2011-01-25
Posts: 79

Re: Where gets Thunar the information about file association?

In /usr/share/applications

Offline

#3 2020-05-18 19:19:10

alcornoqui
Member
Registered: 2014-07-28
Posts: 644

Re: Where gets Thunar the information about file association?

To elaborate on Clio's point, the .desktop files in /usr/share/applications (and I guess other dirs in /home) can have a MimeType field. Examples:

It can be very extensive, as in VLC:

MimeType=application/ogg;application/x-ogg;audio/ogg;audio/vorbis;audio/x-vorbis;audio/x-vorbis+ogg;video/ogg;video/x-ogm;video/x-ogm+ogg;video/x-theora+ogg;video/x-theora;audio/x-speex;audio/opus;application/x-flac;audio/flac;audio/x-flac;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;audio/x-ms-wma;video/x-ms-asf;video/x-ms-asf-plugin;video/x-ms-asx;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-msvideo;audio/x-pn-windows-acm;video/divx;video/msvideo;video/vnd.divx;video/avi;video/x-avi;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/vnd.rn-realaudio;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;audio/x-real-audio;audio/x-realaudio;video/vnd.rn-realvideo;audio/mpeg;audio/mpg;audio/mp1;audio/mp2;audio/mp3;audio/x-mp1;audio/x-mp2;audio/x-mp3;audio/x-mpeg;audio/x-mpg;video/mp2t;video/mpeg;video/mpeg-system;video/x-mpeg;video/x-mpeg2;video/x-mpeg-system;application/mpeg4-iod;application/mpeg4-muxcodetable;application/x-extension-m4a;application/x-extension-mp4;audio/aac;audio/m4a;audio/mp4;audio/x-m4a;audio/x-aac;video/mp4;video/mp4v-es;video/x-m4v;application/x-quicktime-media-link;application/x-quicktimeplayer;video/quicktime;application/x-matroska;audio/x-matroska;video/x-matroska;video/webm;audio/webm;audio/3gpp;audio/3gpp2;audio/AMR;audio/AMR-WB;video/3gp;video/3gpp;video/3gpp2;x-scheme-handler/mms;x-scheme-handler/mmsh;x-scheme-handler/rtsp;x-scheme-handler/rtp;x-scheme-handler/rtmp;x-scheme-handler/icy;x-scheme-handler/icyx;application/x-cd-image;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;application/ram;application/xspf+xml;audio/mpegurl;audio/x-mpegurl;audio/scpls;audio/x-scpls;text/google-video-pointer;text/x-google-video-pointer;video/vnd.mpegurl;application/vnd.apple.mpegurl;application/vnd.ms-asf;application/vnd.ms-wpl;application/sdp;audio/dv;video/dv;audio/x-aiff;audio/x-pn-aiff;video/x-anim;video/x-nsv;video/fli;video/flv;video/x-flc;video/x-fli;video/x-flv;audio/wav;audio/x-pn-au;audio/x-pn-wav;audio/x-wav;audio/x-adpcm;audio/ac3;audio/eac3;audio/vnd.dts;audio/vnd.dts.hd;audio/vnd.dolby.heaac.1;audio/vnd.dolby.heaac.2;audio/vnd.dolby.mlp;audio/basic;audio/midi;audio/x-ape;audio/x-gsm;audio/x-musepack;audio/x-tta;audio/x-wavpack;audio/x-shorten;application/x-shockwave-flash;application/x-flash-video;misc/ultravox;image/vnd.rn-realpix;audio/x-it;audio/x-mod;audio/x-s3m;audio/x-xm;application/mxf;

Minimal, as in qBittorrent:

MimeType=application/x-bittorrent;x-scheme-handler/magnet;

Or nonexistant.

If you want to make any tweaks, these are the canonical instructions:

Adding and removing associations between mimetypes and applications is done with the following syntax in the mimeapps.list file:

[Added Associations]
mimetype1=foo1.desktop;foo2.desktop;foo3.desktop
mimetype2=foo4.desktop
[Removed Associations]
mimetype1=foo5.desktop

The [Added Associations] group defines additional associations of applications with mimetypes, as if the .desktop file was listing this mimetype in the first place.

The entries in [Default Applications] should also be considered to add an association between application and mimetype in the same manner.

The [Removed Associations] group removes associations of applications with mimetypes, as if the .desktop file was NOT listing this mimetype in the first place.

I just learned most of this, thanks for the pointer Clio, hope it helps!

Offline

#4 2020-05-19 13:16:28

Friedrich
Member
Registered: 2016-09-18
Posts: 60

Re: Where gets Thunar the information about file association?

That whats in the mimeapps.list in the [Default Applications] sectionis the application thunar opens the mimetype. [Added Associations] are that applications that i see in the "open with" menu. But i've never seen the third section.

What will happens when a mimetype is in the desktop file of an application but under [Removed Associations] in the mimeapps.list? And what when the mimetype is in the desktop file in /usr/share/applications but not in ~/.local/share/applications? i guess the desktop file in home dir overwrittes the file in /usr/share/applications?

Offline

#5 2020-05-19 16:11:39

eriefisher
Member
From: ON, Canada
Registered: 2008-10-25
Posts: 138

Re: Where gets Thunar the information about file association?

It does not overwrite it but rather supercedes it. What ever you put in /home/user/. is used instead of the default. This way individual users can have different preferences.

Offline

#6 2020-05-23 06:46:34

Friedrich
Member
Registered: 2016-09-18
Posts: 60

Re: Where gets Thunar the information about file association?

Lets say the desktop file of an application has a mimetype but i don't want to use this application with this file and i don't want it in the open with menu in thunar. The only way to hide it is to add the desktop file to [removed applications] in mimeapps.list? There is no way to hide ALL applications except of the default application and added associations?

Offline

#7 2020-05-23 15:55:59

Clio
Member
Registered: 2011-01-25
Posts: 79

Re: Where gets Thunar the information about file association?

In /usr/share/application is the file mimeinfo.cache, look there for the desired entry and comment out the line.
Depending on the entry there are several lines.

Offline

Board footer

Powered by FluxBB