Replies: 4 comments
-
|
What are you trying to do? In my workflow, to get screenshots I use the following configuration: so getting the screenshot of a window works for the one that is focused, and if it is focused, it will be in the monitor area completely. If you wanted to get a screenshot of a window that is not visible, I don't think grim is capable of that, because it takes the frame buffer and selects an area, so anything that is not visible, won't be there, and you won't be able to get your screenshot. If you are trying to do something different, please, explain so I can try to help. For example, you can know if a window is visible by following the hierarchy returned by |
Beta Was this translation helpful? Give feedback.
-
|
I'm using grimshot, which uses slurp's 'predefined rectangle' mode to allow interactive choosing of windows/outputs/areas. It does this: There's no way (without doing a bunch of math) that I can see to filter out partially visible windows. Like if one of my monitors has windows set to 75% width, there will be a partially visible window on one edge. If that edge happens to be adjacent to another monitor, the interactive picker thinks that window spans monitors. I think I can do it now with a Not Shell Script[tm] that either discards or clamps tiled window regions that extend past the output bounds. It would be nice if there were an easy jq filterable way to do it though. |
Beta Was this translation helpful? Give feedback.
-
|
I added I did some testing, and it seems to work. Please, let me know if it works for your use case. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Yep, works exactly how I needed. Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
There doesn't seem to be any way to tell via ipc if a tiled window is fully visible. This is a small issue if you use a tool like grim/grimshot + slurp to select windows in a multi-monitor environment. Any partially visible window on an edge shared with another monitor has a rect that extends into the other monitor. So the calculated rect causes slurp to think the window extends into the adjacent monitor.
Possible to solve the issue by using something more intelligent (and scroll specific) to clamp tiled rects to the output bounds, but some json attribute for easy filtering via the quick and dirty piping to jq would be nice.
Either a new attribute like 'fully_visible: true/false' or even a 'visible_rect' would be helpful. Although I fear 'visible_rect' sets some expectations that might be unrealistic for floating windows...
Beta Was this translation helpful? Give feedback.
All reactions