How to open an image with a flatpak image viewer application using terminal commands?

I'm using Ubuntu 21.10 and uninstalled the GNOME's default image viewer (eog). I installed the gThumb image viewer flatpak app instead.

What i want to achieve - What terminal commands should i use to open a particular image present in my pwd with the gThumb flatpak app?

What i tried - I found out that i could run the gThumb app using flatpak run org.gnome.gThumb but how do i append the image-file name in this command? I tried to pipe it with xargs but it didn't work.

I could open an image using eog <image name> earlier, how do i achieve something similar with the gThumb flatpak app?


You are trying to overcome unneeded problems. It is probably possible as with LibreOffice case with command like

flatpak run org.gnome.gThumb image-photo.png

But to keep it simpler - remove flatpak 3.12.0 version and install deb 3.11.2 version instead by using commands below

flatpak remove org.gnome.gThumb
sudo apt-get install gthumb