1

I need to take a screenshot of the screen from my application that launches another process which will run chromium headless.

I used to perform that using XGetImage but that's X11 API and therefore not working under Weston (my Wayland compositor). I've had a look at https://github.com/krh/weston/blob/master/clients/screenshot.c but after managing to build that code being call from the main, I ended up having the same result than trying to call weston-screenshooter as a command line (Naively I was expecting to be able to get a screenshot by just calling the application). Is there a way to do it? (any code snippet welcomed). Wayland is new for me, I am more used to X11. I've seen the dbus proposition (How can I take a screenshot on Wayland?), I need to perform 30 screenshots per second.

Thank you.

  • "I need to perform 30 screenshots per second." this sound like you want to do some screen casting instead of screenshots (screenshots are still good to get started though) – piegames Jun 07 '22 at 08:52
  • hi @piegames , have you got any solution for this? – krishna Jul 11 '22 at 10:43
  • At the moment I'm hacking around it with a headless sway+grim. But some very kind sould hacked https://github.com/cmeissl/smithay/commit/cc42e4aa50f0fae04017f3dde149e2f1fb5c4eb6 together for me; although I still have to actually try it out. – piegames Jul 11 '22 at 19:59

0 Answers0