How to take screenshot under Wayland?

wayland

Solution

Your question is a bit underspecified. You don't need to write a tool as long as you use the reference compositor `Weston` for `Wayland`. It has this feature built in. You can use `Super + S` to take a screenshot and `Super + R` to record a video in `*.wcap` form which you can then convert to a `*.webm` video.

If you should really be interested in writing such a tool then you should look at `Weston`'s source code here: http://cgit.freedesktop.org/wayland/weston and find the relevant parts.

Problem

I want to write a simple tool that will take screenshots at Wayland. Am I right in my understanding that it would be completely different from Xorg? Could anybody give me any examples?

Original source