You are not logged in.
I wish to set Ristretto as the default image viewer for all image types that Ristretto can open in XFCE. The Gimp editor accidentally set itself as the default viewer for all image types. There are around 115 mime-types affected, i would prefer solutions which do not involve manually verifying 115 types for Ristretto support.
Last edited by user28371 (2023-06-15 18:54:09)
Offline
Hello. I'm interested to know how you could tell 115 mime-types were affected. Did you use `xdg-mime query` or check `mimeapps.list`? Either way you can use that output to set the default application for those mimetypes to be any app you want. You can use `xargs` for that purpose.
If you haven't checked mimeapps.list make sure to take a look. There could also be files named `mimeinfo.cache` next to `mimeapps.list` which are also configuration files for `xdg-mime`.
Offline
Hello. I'm interested to know how you could tell 115 mime-types were affected.
I opened the Default Applications app of XFCE and typed "image". The result is a mess where some images are opened in Firefox, or in Inkscape, or MyPaint, or ristretto, (even mousepad!) but mostly Gimp.
It is probably more than that, Gimp is trying to open PDFs for some reason!
Either way you can use that output to set the default application for those mimetypes to be any app you want.
But how do I know which extensions ristretto can open? Can it do avif, or webp, or animated gifs, rgba, tiff, heif, or svg? Given that applications can set themselves as the defaults, they must know what they support. Is that available?
Offline
All applications have an application entry which contains information such as their name, a short description and the mimetypes they support. They're all installed to `/usr/share/applications/`. For example Gimp's entry is `/usr/share/applications/gimp.desktop`. If you search for `MimeType` in the file you'll find a list of all the mimetypes Gimp supports. Here's a quick command to get it:
$ grep MimeType /usr/share/applications/gimp.desktopRistretto should have an entry too or it wouldn't show up in the applications menu.
Offline
grep MimeType /usr/share/applications/gimp.desktop
Ooooh, i see! This is brilliant, thanks ![]()
Offline