Mimeinfo.cache file, inode/directory line rewritten with many updates

I have a couple of infrequently used apps which added themselves to the inode/directory line of the mimeinfo.cache file during installation. (They do this with other distros as well.) The unwanted result is they keyboard shortcut for opening the home folder launches one of these apps instead of the default file manager.

Simple solution (which works on other distros): edit the mimeinfo.cache file manually to remove those additions and all is well — until I run a system update.

Those system updates frequently (annoyingly frequently!) rewrite the mimeinfo.cache file, returning those additions to the inode/directory line and causing the keyboard shortcut for opening the home folder to launch a different app. Is there a way to prevent the mimeinfo.cache file from being ‘restored’ with unwanted entries?

1 Like

First of all, Welcome to the community!

However,

You do not have to update your system every day. This is your choice, your system. You can do it once a week.

Now, to the question:

You, again, have a few choices:

  • Simplest choice - remove the extra apps if you don’t need them OR
  • Run your default application setter as root (from the terminal) OR
  • Run your default application setter as root (by logging into the root account) OR
  • Another way someone else may add below

default application setter = system settings or xdg-mime (or here) depending on your DE or WM of choice

1 Like

Best to just leave mimeinfo.cache alone, and set your preferred applications in ~/.config/mimeapps.list. Under [Default Applications] you can set the applications you would prefer along with the association (you can copy and paste right out of mimeinfo.cache if you’d like).

For example, if you want Thunar to be your default file explorer you can set it up like this:

[Default Applications]
inode/directory=thunar.desktop

A while ago I found this GUI app that’s in the AUR which basically sets this file up for you: https://github.com/magnus-ISU/selectdefaultapplication

It’s stupid easy to use. The menu shows all your apps that have a .desktop file, you just click on one and it will show all the different types of files it can open. Highlight any file types you want that app to open by default, and it will set up your ~/.config/mimeapps.list for you.

For example, let’s say I want to set mpv as the default for any file type it supports. Click the app, optionally de-select anything you don’t want it to be the default for (it defaults to selecting all), then click “set as default application”:

Now the app shows that mpv is the app which currently opens these file types:

When I open ~/.config/mimeapps.list I can see all these file associations have been added below my Thunar entry:

[Default Applications]
inode/directory=thunar.desktop
video/x-theora+ogg=mpv.desktop
video/mp4=mpv.desktop
audio/x-vorbis+ogg=mpv.desktop
video/x-flv=mpv.desktop
application/ogg=mpv.desktop
application/mxf=mpv.desktop
application/x-shorten=mpv.desktop
application/vnd.rn-realmedia=mpv.desktop
video/mp2t=mpv.desktop
audio/x-scpls=mpv.desktop
application/x-matroska=mpv.desktop
video/webm=mpv.desktop
audio/AMR=mpv.desktop
audio/x-wavpack=mpv.desktop
video/vnd.mpegurl=mpv.desktop
audio/vnd.dts=mpv.desktop
video/x-matroska=mpv.desktop
video/x-ms-wmv=mpv.desktop
video/x-ogm+ogg=mpv.desktop
video/vnd.rn-realvideo=mpv.desktop
audio/mpeg=mpv.desktop
application/vnd.apple.mpegurl=mpv.desktop
audio/x-ms-wma=mpv.desktop
video/vnd.avi=mpv.desktop
application/smil+xml=mpv.desktop
audio/aac=mpv.desktop
video/x-flic=mpv.desktop
video/mpeg=mpv.desktop
audio/vnd.dts.hd=mpv.desktop
audio/ac3=mpv.desktop
application/vnd.ms-asf=mpv.desktop
application/x-cue=mpv.desktop
audio/x-ms-asx=mpv.desktop
audio/x-aiff=mpv.desktop
video/quicktime=mpv.desktop
audio/ogg=mpv.desktop
audio/x-matroska=mpv.desktop
audio/webm=mpv.desktop
application/sdp=mpv.desktop
audio/x-tta=mpv.desktop
audio/x-musepack=mpv.desktop
video/ogg=mpv.desktop
audio/x-adpcm=mpv.desktop
audio/vnd.rn-realaudio=mpv.desktop
audio/mp4=mpv.desktop
audio/mp2=mpv.desktop
video/3gpp2=mpv.desktop
audio/vnd.wave=mpv.desktop
audio/x-mpegurl=mpv.desktop
audio/flac=mpv.desktop
video/dv=mpv.desktop
video/3gpp=mpv.desktop
audio/x-ape=mpv.desktop

Very fast and easy!

2 Likes

ddnn, thanks for the welcome — been using EndeavourOS for quite some time (tend to distro hop infrequently, but think I may be here for awhile, previously used Manjaro), but finally ran into problem I couldn’t solve on my own.

Realise I don’t need to update every day, but used to be network security (now retired) and have a mindset of updating frequently and usually update two to four times per day.

Didn’t want to remove the apps as they were 'infrequently used´ not ‘extra’.

Went with suggestion from BluishHumility as it seemed most direct and simple. Editing the ~/.config/mimeapps.list seems to have done the trick nicely. Thanks!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.