News for hackers. Stuff that matters.
Re:Understanding the working of X11 from the ground up (2017) by simion314 on Sunday September 22, 2019 @03:07AM (#21040074)
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, probably when Wayland will be actually ready we will need something to replace it or a Wayland 2 that learned from first attempt mistakes.

Re:Understanding the working of X11 from the ground up (2017) by pedrocr on Sunday September 22, 2019 @06:41AM (#21040661)
>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)

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...

Re:Understanding the working of X11 from the ground up (2017) by aloer on Sunday September 22, 2019 @03:28AM (#21040112)
Could you tell us more about the use case here? What do you use the OCR for?
Re:Understanding the working of X11 from the ground up (2017) by simion314 on Sunday September 22, 2019 @04:23AM (#21040277)
I suffer of macular degeneration https://en.wikipedia.org/wiki/Macular_degeneration , so I am having issues reading texts , I am using TTS and Zoom features for most applications but the big issue I have is with video games. For open source game engines I can patch them to have the text pushed to my TTS scripts but for closed source game engine OCR or zoom is the only solution but it has a lot of issues.

1 my zoom follows the mouse but this is broken is nome games where the trying to move the zoom area to the edge where the text is would move the camera in game , pausing the game is a solution but some games would put a Pause screen on top of te text I want to read.

The OCR has issues when games use fancy fonts, old games use some pixelated fonts that are impossible to OCR, other games use more artistic fonts that are also hard to OCR, other games use text over semi transp[arent background and it makes hard to separate the text from the background.

For DirectX I am thinking if I could maybe intercept the draw text calls, I am considering making a Stack OVerflow post but I am a bit anxious that I am not sure what the correct title and tags should be and I could get the off topic and the question closed.