Earlier quoted context omitted.
The basic problem with X11 is it wraps a whole bunch of things into one software package. So in theory you have to know about fonts, OpenGL, graphics drivers & memory management, the window model and networking simultaneously to configure and run the thing. Wayland is a protocol for a well designed future where all that functionality is broken up into separate pieces of software. Wayland handles the window model and…
The issue is I need the powerfull features, like I have a script that OCR a region of the screen when I press a button (the coordinates depend of the app that runs) so I do not want a GUI provided by the DE to let me capture the screen. Anyway the issue with Wayland is that it is not ready, the important screen recording feature is yet not here,I seen also some complaints from gamers and their issues are a won't fix,…
This is easy to do. Something like grim to take the screenshot of whatever region you want:
https://github.com/emersion/grim
And calculate the coordinates you need by querying the window manager. In sway (i3 compatible tiling WM) that would be:
$ swaymsg -t get_tree
To get a JSON of all the windows currently open and do whatever math is needed.
You can also do a hand selection using slurp:
https://github.com/emersion/slurp
It works together with grim like this:
$ grim -g "$(slurp)" screenshot.png
Having recently moved from X to Wayland there are still some things missing sometimes but they're not many. If you want a DE at least GNOME and I think KDE as well are making the switch reasonably seamless. And there are some features that Wayland solves much more thoroughly (e.g., tear free output, fractional scaling). The network transparency part, that is often brought up but rarely used in X is also being delivered:
https://lists.freedesktop.org/archives/wayland-devel/2019-Au...