You are not logged in.

#1 2023-04-24 22:40:34

osmarks
Member
Registered: 2023-04-24
Posts: 3

[Solved] How do I take a screenshot of the active window in labwc?

I've recently switched to labwc (from LXDE). However, one thing I haven't been able to get to work is the ability to take a screenshot of the window I have focused. I can use "grim" and "slurp" to pick regions of the screen fine, and screenshot an entire display, but there seems to be no way to get a specific window which is not reliant on compositor-specific protocols like swaymsg which labwc doesn't support. Is there another way to make this work?

Last edited by osmarks (2023-04-25 15:11:13)

Offline

#2 2023-04-24 23:04:21

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [Solved] How do I take a screenshot of the active window in labwc?

Moving to AUR issues (labwc is an AUR package).

Offline

#3 2023-04-25 01:00:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: [Solved] How do I take a screenshot of the active window in labwc?

osmarks wrote:

but there seems to be no way to get a specific window which is not reliant on compositor-specific protocols

Correct.  This information is only available to the compositor, so you can only get it from the compositor.  There's no way around that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2023-04-25 12:31:07

osmarks
Member
Registered: 2023-04-24
Posts: 3

Re: [Solved] How do I take a screenshot of the active window in labwc?

I was unsure if there was a standardized protocol for it: Waybar can at least read my active windows (I think through "wlr_foreign_toplevel_management_unstable_v1", which seems to include setting window coordinates but not getting them) in a slightly less compositor-specific way.

Offline

#5 2023-04-25 12:40:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,534
Website

Re: [Solved] How do I take a screenshot of the active window in labwc?

There is no stable / standardized protocol - even for what waybar does.  There are quite a few non-standardized protocols such as the one you note (see the "unstable_v1" in that name), and whether these are supported is entirely compositor specific.

So labwc might provide some way of acheiving your goal, but it would absolutely be a compositor-specific solution which was my point: there is no generic or non-compositor specific way of doing this.  So your search should focus on labwc docs or code.

Last edited by Trilby (2023-04-25 12:40:49)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2023-04-25 15:11:05

osmarks
Member
Registered: 2023-04-24
Posts: 3

Re: [Solved] How do I take a screenshot of the active window in labwc?

It looks like there is deliberately nothing beyond the supported protocols, which do not include this, so I wrote a very accursed patch to get the information out of the compositor by IPC. It doesn't obviously break everything horribly so this is fixed I guess.

Last edited by osmarks (2023-04-25 15:12:54)

Offline

Board footer

Powered by FluxBB