artemsen / swayimg

Image viewer for Wayland
MIT License
380 stars 31 forks source link

Option to display in new window #213

Closed stargazer1984 closed 1 week ago

stargazer1984 commented 2 weeks ago

Swayimg looks like an awesome project which supports more image formats then any other wayland image viewer I know but I am missing any option to make it behave like other image viewers in that it opens images in a new window. Other applications like imv open the image in a new window, allowing easy viewing in terminal based file managers. However I have not yet found any way to do this with swayimg and I would expect that I am not the only one to miss this behavior.

Is there any way to have swayimg open an image in a new window to work exactly like imv/feh and most other image viewers?

artemsen commented 2 weeks ago

I'm not sure I understood you correctly, but if you use Sway WM and want to disable the floating mode, then try

$ SWAYSOCK=/dev/null swayimg photo.jpg
stargazer1984 commented 2 weeks ago

That works exactly like I want it to. But why do I need the mask the sway socket to have swayimg behave like the default windows in sway? Or in other words why does swayimg default to floating mode when I have no such config in my sway config?

artemsen commented 2 weeks ago

It is the Sway integration mode: swayimg creates an "overlay" above the currently active window, which gives the illusion that you are opening the image directly in a terminal window. This is useful if you don't want to break the workspace layout.

stargazer1984 commented 2 weeks ago

Ok, but wouldn't it make sense to have an option that makes swayimg behave like a normal application without this hacky solution of blocking the socket?

artemsen commented 2 weeks ago

There was an option to disable integration with Sway WM, but it was removed some time ago, since the same can be done by unsetting an environment variable described in the man.