# Capturing screenshots on WebOS

**URL:** <https://forum.webosose.org/t/capturing-screenshots-on-webos/326>\
**Category:** Uncategorized\
**Created:** [April 26, 2018, 7:38am UTC](https://forum.webosose.org/t/capturing-screenshots-on-webos/326 "2018-04-26T07:38:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilyai](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/ilyai/32/91_2.png) [@ilyai](https://forum.webosose.org/u/ilyai)\
**Post date:** [April 26, 2018, 7:38am UTC](https://forum.webosose.org/t/capturing-screenshots-on-webos/326/1 "2018-04-26T07:38:03Z")

</div>

I'm looking for a way to take screenshots either with some utility or programmatically using API. The application I'm using has that functionality (written in Java, AWT library) but it doesn't work since WebOS seem to be using Wayland, and not X11. The following error is logged:

`java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.`

I also considered using Xwayland in order to have X11 compatible interface, though couldn't find any related information and if capturing screenshots is possible with it.

---

<div class="post-metadata">

**Author:** ![Herrie](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@Herrie](https://forum.webosose.org/u/Herrie)\
**Post date:** [April 26, 2018, 1:17pm UTC](https://forum.webosose.org/t/capturing-screenshots-on-webos/326/2 "2018-04-26T13:17:27Z")

</div>

> [@ilyai](#):
>
> Wayland

It seems there's no API available for this in webOS OSE (yet). It used to be in LunaSysMgr from Open webOS as per [https://github.com/openwebos/luna-sysmgr/blob/1393f0af5dd8d9f0e9cc79627f4acb226f8c8d45/Src/base/WindowServer.cpp#L646](https://github.com/openwebos/luna-sysmgr/blob/1393f0af5dd8d9f0e9cc79627f4acb226f8c8d45/Src/base/WindowServer.cpp#L646)

On legacy webOS 3.0.x you could take screenshots with Home & Power button.

In LuneOS (based on Open webOS) we implemented it in our own UI.

---

<div class="post-metadata">

**Author:** ![ilyai](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/ilyai/32/91_2.png) [@ilyai](https://forum.webosose.org/u/ilyai)\
**Post date:** [April 26, 2018, 1:56pm UTC](https://forum.webosose.org/t/capturing-screenshots-on-webos/326/3 "2018-04-26T13:56:26Z")

</div>

Thanks for your response.  
And what wayland compositor is used now in webOS OSE? And are there any plans to implement screenshot functionality in it?  
As I understand there's no use in installing xwayland as wayland doesn't have screenshot API anyway?

---

<div class="post-metadata">

**Author:** ![nicolas](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@nicolas](https://forum.webosose.org/u/nicolas)\
**Post date:** [April 27, 2018, 12:23am UTC](https://forum.webosose.org/t/capturing-screenshots-on-webos/326/4 "2018-04-27T00:23:10Z")

</div>

I don't know whether it is helpful to you or not. but luna-surfacemanager in webOS OSE has a screenshot source.

> <https://github.com/webosose/luna-surfacemanager/blob/master/modules/weboscompositor/webosscreenshot.h>

---

<div class="post-metadata">

**Author:** ![ilyai](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/ilyai/32/91_2.png) [@ilyai](https://forum.webosose.org/u/ilyai)\
**Post date:** [June 8, 2018, 4:40pm UTC](https://forum.webosose.org/t/capturing-screenshots-on-webos/326/5 "2018-06-08T16:40:45Z")

</div>

I was able to capture screenshot with this command:

`luna-send -n 1 -f luna://com.webos.surfacemanager/captureCompositorOutput '{"output":"/home/root/screenshot-temp.jpg","format":"JPG"}'`

Though a problem that at the time when screenshot was taken a video was playing on the screen, screenshot is always a black picture. On other content it works.

---

<div class="post-metadata">

**Author:** ![yuri](https://avatars.discourse-cdn.com/v4/letter/y/71c47a/32.png) [@yuri](https://forum.webosose.org/u/yuri)\
**Post date:** [April 9, 2020, 3:22pm UTC](https://forum.webosose.org/t/capturing-screenshots-on-webos/326/6 "2020-04-09T15:22:08Z")

</div>

Thank you for the luna-send command. It works on WebOSE 1.0 build for raspbery3.

Unfortunately the build for raspbery4, I got in  
[http://build.webos-ports.org/webosose/](http://build.webos-ports.org/webosose/)  
returns "errorText": "com.webos.surfacemanager is not running.".  
I'll be very grateful if someone let me now how to get capturescreen?

---

<div class="post-metadata">

**Author:** ![yuri](https://avatars.discourse-cdn.com/v4/letter/y/71c47a/32.png) [@yuri](https://forum.webosose.org/u/yuri)\
**Post date:** [April 10, 2020, 9:38am UTC](https://forum.webosose.org/t/capturing-screenshots-on-webos/326/7 "2020-04-10T09:38:48Z")

</div>

I got the picture  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/developer1/original/1X/9d9cf092ccbabe8ef8d1e2a4fb161fd21a2a4122.png)  
The reason was If monitor is not connected there will be "errorText": "com.webos.surfacemanager is not running.".
