site  contact  subhomenews

Mime handling fix for KDE apps

October 20, 2024 — BarryK

This fix is going to apply to more than KDE apps; any app that reads /usr/share/applications/mimeapps.list to determine file associations. For example, a .doc file should be opened in LibreOffice.

This issue came up in discussion of Dolphin file manager on the forum:

https://forum.puppylinux.com/viewtopic.php?p=133545#p133545

I have focussed on file associations for ROX-Filer, which are generated by /usr/bin/build-rox-sendto. This script is run in woofQ when easy.sfs is created, and also when any app that has a .desktop file is installed or removed, or any sfs installed or removed. It creates the associations in /etc/xdg/rox.sourceforge.net/OpenWith -- if you look there, be warned, they are all hidden folders.

SeaMonkey and Firefox, and some other apps, look at /etc/mime.types for file associations, but my understanding is that this is an older mechanism not read by most modern apps.

I discovered that Dolphin, a KDE app, stores file associations in ~/.config/mimeapps.list

A bit of online reading, found the system-wide location, for all users, is /usr/share/applications/mimeapps.list

build-rox-sendto now also generates /usr/share/applications/mimeapps.list, and it works great. Here right-clicked on a .svg image file in Dolphin:

img1

...it has chosen mtPaint as the default, that will run if left-click on the .svg file. To change the default, you would have to edit the ~/.config/mimeapps.list file. I presume just copy the one you want as default from /usr/share/applications/mimeapps.list, under the "[Default Applications]" heading. It seems that Dolphin can't do this for you.

Here is the change to /usr/bin/build-rox-sendto:

https://github.com/bkauler/woofq/commit/cba281b0cb79720ff8bb47c9ad588bdeaff39cef

This is a great improvement for running many different apps in Easy.   

Tags: easy