You are not logged in.

#1 2023-06-14 20:04:54

user28371
Member
Registered: 2018-12-07
Posts: 29

[SOLVED] How to set Ristretto as the default image viewer

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

#2 2023-06-15 07:08:42

swodig112
Member
Registered: 2020-08-23
Posts: 4

Re: [SOLVED] How to set Ristretto as the default image viewer

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

#3 2023-06-15 16:26:28

user28371
Member
Registered: 2018-12-07
Posts: 29

Re: [SOLVED] How to set Ristretto as the default image viewer

swodig112 wrote:

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!

swodig112 wrote:

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

#4 2023-06-15 18:15:47

swodig112
Member
Registered: 2020-08-23
Posts: 4

Re: [SOLVED] How to set Ristretto as the default image viewer

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.desktop

Ristretto should have an entry too or it wouldn't show up in the applications menu.

Offline

#5 2023-06-15 18:53:50

user28371
Member
Registered: 2018-12-07
Posts: 29

Re: [SOLVED] How to set Ristretto as the default image viewer

swodig112 wrote:

grep MimeType /usr/share/applications/gimp.desktop

Ooooh, i see! This is brilliant, thanks smile

Offline

Board footer

Powered by FluxBB