How can I remove all instances of a program from file associations?

In KDE, I can easily search for a file association and set the default and alternate programs used to open it. What I want to do is search for a program, and set the file types. Okay, what I really want to do is just wipe out all instances of certain programs.

Install any program with wine, and you get notepad added to the list for every flavor of text, plus Internet Explorer for everything web-related, one instance per program installed with wine! And aegisub, a subtitle editor for videos, also shows for everything having to do with text. Deleting them one-by-one from hundreds of file types is tedious, but is there a config file to edit? Then I could search-and-replace. As nearly as I can determine, the config files in home/.local/share/menu only show changes to the default, and I can’t find where the default is stored in the root system. /usr/share/applications/mimeapps.list is empty, and editing mimeapps.cache in the same directory makes no difference for the next new user profile.

Thanks,

GEF

Is it bad etiquette to answer my own question?

So that empty file I mentioned turns out to be the right one: /home/<username>/.local/share/applications/mimeapps.list.

If it doesn’t exist, create it, and add the lines

[Removed Associations]
text/plain=aegisub.desktop;wine-extension-txt.desktop;

Or whatever mimetype, or whatever app by the name of its desktop file.

I found a mimeinfo.cache file, and got the format for the desktop files. I just searched for wine, and copied every line where the mimetype didn’t include wine, but the desktop files did. For instance, the line “application/x-wine-extension-msp=wine-extension-msp.desktop;” should not go in removed applications because you’ll still want wine top open windows programs.

It should go without saying, but I want to be clear: If other apps showed up in the list for a mimetype, I deleted them from the line that I added to [Removed Associations] group. For instance, I found this line in mimeapps.cache, “application/xml=wine-extension-xml.desktop;google-chrome.desktop;” but what I copied was just “application/xml=wine-extension-xml.desktop;” because I still want chrome to open xml files.

GEF

You may search for:

karl@erlangen:~> find -name '*.list'
./.local/share/applications/mimeapps.list
./.config/mimeapps.list
./.config/mate-menu/applications.list
karl@erlangen:~> 
erlangen:~ # find / -xdev -name '*.list'|xargs grep -l Application
/var/cache/gio-2.0/lxde-mimeapps.list
/var/cache/gio-2.0/gnome-mimeapps.list
/var/cache/gio-2.0/xfce-mimeapps.list
/usr/share/applications/gnome-mimeapps.list
/usr/share/applications/defaults.list
/usr/share/gdm/greeter/applications/mimeapps.list
/usr/share/xfce/applications/defaults.list
erlangen:~ #