artemsen / swayimg

Image viewer for Wayland
MIT License
371 stars 30 forks source link

Option to display in new window #213

Open stargazer1984 opened 1 day ago

stargazer1984 commented 1 day 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 1 day 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 1 day 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 1 day 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 1 day 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 14 hours 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.