Still it opens in gwenview.
It would be nice to know what caused it on the OPās computer⦠I donāt think it is a packaging issue.
Whether you click on an icon in Dolphin, click on a hyperlink in Konsole, or use xdg-open
should not matter, it is all the same thing anyway.
I donāt think it is a packaging issue.
Then why does it happen on my vanilla Arch VM with LXQT?
It sounds almost like KDE introduced some workaround or something, which hasnāt affected my own EndeavourOS installation for some reason.
Iām looking at the source files of the GIMP package:
Iām not seeing anything that would cause thatā¦
It takes the binary from here:
https://download.gimp.org/pub/gimp/v2.10/
Do you have a defaults.list
file inside /usr/share/applications/
or ~/.local/share/applications/
?
Because I donāt, neither in EOS nor the VM.
Nope, no file named defaults.list
anywhere on my system.
Same.
okā¦
The problem went away at some point today, I have no idea what did it. I did not consciously change anything relating to MimeTypes on my system. I only installed virt-manager and some dependencies. But Gwenview was the default again.
But it immediately reappeared once I reinstalled GIMP (over the existing installation).
What the heck?
Edit: update-desktop-database
seems to do it. So the issue is only some kind of transient glitch of installing GIMP with pacman that gets fixed when the mime cache is rebuilt. I guess Iāll set up a hook.
However, in the VM this method doesnāt work.
Indeed. Thatās really oddā¦
In any case, Iām fine with this workaround, so thanks for the help everyone.
Iām not gonna file the Arch bug, since it only seems to affect specific Arch setups and your fresh KDE installs donāt have it. If someone with LXQT who has this problem but doesnāt have vanilla Arch finds this thread and wants me to file the bug, let me know.
It would be nice to know exactly what causes it and how to reproduce itā¦
Thanks I didnāt know that you can use grep
straight away on files.
Iāve been grepping wrong since a year.
Mine opens in Gwenview also.
Looks like file /usr/share/applications/mimeinfo.cache
is updated sometimes by the system, e.g. when āan invalid MIME type is metā according to the man page of update-desktop-database
.
Havenāt tested this, but maybe backing up that file (and restoring when these problems occur) might help? Probably needs also checking the differences e.g. with meld
.
Edit: thereās also file ~/.local/share/applications/mimeinfo.cache
. That might help too.
Edit2: used thunar
file manager to change application bindings. That didnāt change any of those files, but worked in thunar
anyway.
Hi! Not on Endeavour, but I got pointed to this thread from elsewhere, and Iām hoping I might be able to disentangle whatās going on a bit.
TL;DR: I think something (file manager? desktop?) is incorrectly treating the entries in mimeinfo.cache
as an ordered list when theyāre actually unordered.
mimeinfo.cache
is supposed to be autogenerated, and regenerated whenever a desktop application is installed or removed. So manually editing/restoring it is not a practical long-term solution. It says which apps can open a given mimetype (like image/jpeg
), but not anything about which app should be preferred. The man page for update-desktop-database
(the command to generate this file) is clear that the order doesnāt mean anything:
The order of the desktop files found for a MIME type is not significant. Therefore, an external mechanism must be used to determine what is the preferred desktop file for a MIME type.
In fact, it doesnāt even produce a consistent order. So if something takes the first application for Edit: looks like this actually got fixed a couple of years ago, so it shouldnāt be random. Of course, āgimpā sorts before āorg.kdeā¦ā, so if something is relying on the order there, it wonāt give you the result you want.image/jpeg
in that file, you get pot luck each time itās regenerated (which can be when any application is installed, even if itās nothing to do with images).
If my guesswork is correct, Iād be most inclined to file a bug against the desktop/file manager thatās choosing the application: if there isnāt a default application, it should either prompt the user to pick one, or at least make a consistent choice that doesnāt depend on the random order in mimeinfo.cache
.
At the distro level, you can address this by defining default applications in a mimeapps.lst
file. Fedora does this in a very Gnome-focused way, but the mime-apps spec allows for more subtle approaches - defaults can be given in a priority order (to use the first available one), and you can have different defaults for different desktops with files like kde-mimeapps.lst
. Naturally, user preferences (especially ~/.config/mimeapps.lst
) override the system-provided defaults.
Welcome to the forum, and thank you for the explanation!
EDIT:
However, I am not convinced youāre completely correct. Just looked at my mimeinfo.cache
for the entry for image/gif
and this is what I have:
image/gif=gimp.desktop;okularApplication_kimgio.desktop;org.kde.gwenview.desktop;org.kde.mobile.okular_kimgio.desktop;
As you can see, Gwenview is somewhere in the middle of the list. The order should not matter. And it doesnāt, because Gwenview correctly opens gif files on my system. If some component of my system treated this as an ordered list, then it would use either the first or the last entry to open the file, not the one in the middle.
I have found no way to reproduce the issue the OP has.
Is it possible that you have a preference set in a mimeapps.list
file somewhere? See this page for the list of locations where that file might be. Youāre looking for [Default Applications]
sections in each of those files.
Iād guess that it would only use the first one from mimeinfo.cache
if it hasnāt found a default application from any of those mimeapps.list
files.
(Not directly related, but I also just found that the Arch wiki has some good information about this: Default applications and XDG MIME applications).
There is no file named mimeapps.list
on my entire systemā¦
~/.config/mimeapps.list
?
It should be created in case youāve manually overriden Open with to some non-default program