Blog of Raivo Laanemets

Stories about web development, freelancing and personal computers.

Firefox opening PDF in GIMP again


Slackware has issues with the mimeinfo.cache file. In certain configurations (install with KDE) it causes PDF files in Firefox to be opened with GIMP. This is a known issue with other distros too.

Most guides tell you to edit the /usr/share/applications/mimeinfo.cache file. However, once something runs the command update-desktop-database, the cache file is overwritten and the fix is lost. Something runs this for me on each boot and it's incredibly annoying.

A related issue is Sublime Text opening the packages directory in Cervisia. This is caused by the same bug (a system design issue, not a bug?).

There should be a fix through overriding it with the mimeapps.list in the same directory. Unfortunately it does not work. At least it did not work for me.

Solution

A more permanent solution is possible. The .desktop files in the same directory (and in the kde4 subdirectory) have to be modified to remove the unwanted entries in the cache file. The cache file contains the reverse index (from given mime type to .desktop files). This is built from the MimeType properties in the .desktop files. For example, to prevent gwenview from opening directories, the inode/directory; part in its MimeType property has to be removed.

After the .desktop files are updated, you must run the update-desktop-database command to get the updated cache file. If it contains no unwanted entries under application/pdf and inode/directory then the work is done. Otherwise repeat it until you only have those apps left that should actually open those types of files or directories.


Comments

No comments have been added so far.

Email is not displayed anywhere.
URLs (max 3) starting with http:// or https:// can be used. Use @Name to mention someone.