How to make a screen capture in Weston

Revision as of 14:43, 10 November 2023 by Registered User
Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP25x lines


Note: a screen capture is also referred to as a snapshot or screenshot. These words all mean the same thing.

1. Screen capture without a keyboard

The Weston debug tool weston-screenshooter is used to take screen captures in PNG format. This tool can be used only with Wayland Weston configured in debug mode.
Add the following line to the file named "/etc/default/weston" to enable the Weston debug mode:

OPTARGS=--debug
# if OPTARGS variable was already there, append "--debug" to it, for instance
# OPTARGS=--something
# becomes
# OPTARGS=--something --debug

The Weston debug mode is taken into account after a stop/start of the Wayland Weston service (refer to the article on How to stop and start Weston).

As Weston debug mode is now enabled, you can take a screen capture using the following command:

weston-screenshooter

Warning white.png Warning
If Weston is configured with a "weston" user instead of a "root" user, use the following commands:
 su -l "weston" -c "weston-screenshooter"

The captured picture, in PNG format, is named wayland-screenshot-*.png (* represents the date- and timestamp) and stored in /home/weston, /home/root, or /, depending on your Weston configuration.

ls /home/weston typescript wayland-1 wayland-1.lock wayland-screenshot-2023-10-11_19-55-31.png weston-previous.log weston.log

You can copy the screenshot from the board to the host PC in the <file-path> directory (for example, using the scp command).

scp root@<ip address>:/home/weston/wayland-screenshot-*.png <file-path>/

2. Screen capture with a keyboard

Refer to Weston keyboard shortcut for screenshot capture to find out how to take screen captures with Weston using keyboard shortcuts.