WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Howto: take a screenshot on Weston  (Read 1727 times)

aus9

  • Guest
Howto: take a screenshot on Weston
« on: August 04, 2018, 06:22:01 PM »
Hi

press the logo key (and) s should output a png file in your home dir.

offtopic
#######

screenshot.sh and other screenshot apps are unlikely to work on Wayland.

Apparently this is a feature of Wayland
Quote
Apps can no longer see everything on the screen and spy on you.

ref
https://support.hubstaff.com/screenshot-capture-support-wayland-linux/

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6007
Re: Howto: take a screenshot on Weston
« Reply #1 on: August 04, 2018, 06:33:37 PM »
Hi aus9
If you are running 32 bit and feel like experimenting, see if  grabber.tcz  works on it.

aus9

  • Guest
Re: Howto: take a screenshot on Weston
« Reply #2 on: August 04, 2018, 07:45:51 PM »
Rich

I grabbed the info file as I only run 64 bit and WOW you are the author. Congrats

How do I build it for 64 bit? or any plans to submit to 64.

I am interested as I have built a compositor for Wayland and "it's" screen capture does not yet work for me,
so having another way to capture would be excellent. And the Weston kb combo does not work on my new compositor
« Last Edit: August 04, 2018, 07:47:35 PM by aus9 »

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6007
Re: Howto: take a screenshot on Weston
« Reply #3 on: August 04, 2018, 08:23:38 PM »
Hi aus9
Attached are the source files for  grabber  if you would like to try compiling it. I don't have 64 bit hardware. You'll need to
adjust the  CompileGrabber  script. You might want to move the 2  gcc  lines to the top of the script followed by an  exit
command until you get it compiling correctly.

    [EDIT]: Attachment removed and reposted here: http://forum.tinycorelinux.net/index.php/topic,18412.msg138492.html#msg138492
« Last Edit: August 06, 2018, 08:56:18 PM by Rich »

aus9

  • Guest
Re: Howto: take a screenshot on Weston
« Reply #4 on: August 04, 2018, 11:21:11 PM »
@ Rich

thanks I am sure I need to tidy it up into a build script but I must have got most things right as proof on libX
https://imgur.com/a/ohdVU7t

but on sway....running grabber.....the screen goes blank but the little box appears
pressing s then q shows a screenshot is grabbed but unfortunately its just a blank image or black image

this is not the fault of grabber, I believe it relates to Wayland as mentioned above.

In case I have made mistakes can I start a new thread for grabber? Or is imgur image proof that any mistakes are minor?

cheers

aus9

  • Guest
Re: Howto: take a screenshot on Weston
« Reply #5 on: August 05, 2018, 01:52:19 AM »
and drifting completely offtopic, I built flameshot but it depends on qt5 stuff so is much larger than using mtpaint.
but I used mtpaint with a time delay to capture flameshot gui in action.

its a little like grabber but bigger and with more gui buttons to click
https://imgur.com/a/Q3MlXXn

it does not work on sway either so did not submit.
If you are interested on 32 bit its source is here
https://github.com/lupoDharkael/flameshot

and in a normal big web browser there is a bit of animation running showing on its run
« Last Edit: August 05, 2018, 01:57:19 AM by aus9 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 10204
Re: Howto: take a screenshot on Weston
« Reply #6 on: August 05, 2018, 02:02:50 AM »
since the weston supplied screenshot works, you could try isolating the code for use in other wayland wm?

aus9

  • Guest
Re: Howto: take a screenshot on Weston
« Reply #7 on: August 05, 2018, 05:47:29 AM »
Juanito
I have no idea how to do that. AFAIK
Code: [Select]
tc@box:/usr/local/lib/weston$ strings weston-screenshooter
/lib/ld-linux-x86-64.so.2
libcairo.so.2
__gmon_start__
_fini
libpixman-1.so.0
libfontconfig.so.1
libbz2.so.1.0
libharfbuzz.so.0
libglib-2.0.so.0
libpcre.so.1
libfreetype.so.6
libgraphite2.so.3
libEGL.so.1
libxcb-dri2.so.0
libxcb-dri3.so.0
libxcb-xfixes.so.0
libxcb-present.so.0
libxcb-sync.so.1
libxshmfence.so.1
libgbm.so.1
libwayland-server.so.0
libexpat.so.1
libGLESv2.so.2
libdrm.so.2
libglapi.so.0
libpng16.so.16
libpthread.so.0
libxcb-shm.so.0
libX11-xcb.so.1
libxcb-render.so.0
libXrender.so.1
libXext.so.6
libX11.so.6
libxcb.so.1
libXau.so.6
libXdmcp.so.6
libdl.so.2
libz.so.1
libxkbcommon.so.0
libwayland-cursor.so.0
libwayland-client.so.0
libffi.so.6
librt.so.1
libm.so.6
libc.so.6
__libc_start_main
wl_proxy_marshal_constructor_versioned
program_invocation_short_name
__progname
stderr
fprintf
fputs
fputc
exit
malloc
free
cairo_image_surface_create_for_data
getenv
localtime
strftime
__errno_location
snprintf
fdopen
fclose
cairo_surface_write_to_png
cairo_surface_destroy
strcmp
wl_output_interface
wl_list_insert
wl_proxy_add_listener
wl_shm_interface
wl_proxy_get_user_data
wl_display_connect
wl_list_init
wl_registry_interface
wl_proxy_marshal_constructor
wl_display_dispatch
wl_display_roundtrip
strcpy
strcat
mkostemp
unlink
posix_fallocate
mmap
wl_shm_pool_interface
wl_buffer_interface
wl_proxy_marshal
wl_proxy_destroy
_edata
__bss_start
_end
GLIBC_2.2.5
GLIBC_2.7
AWAVH
AUATUSH
p(H9
H(L9
D$$E1
D$(P1
([]A\A]A^A_
H=`1`
AWAVA
AUATUS
B(L9
r Lc
AUAV
AUAVL
[]A\A]A^A_
ATUH
[]A\H
[]A\
ATUH
[]A\
ATUH
[]A\
AWAVI
AUATI
X[]A\A]A^A_
[%s]
clients/screenshot.c
%s:%d:
out of memory
 (%zd)
XDG_PICTURES_DIR
%F_%H-%M-%S
wayland-screenshot-
%s%s%s%s%s
.png
%s%s%s%s-%d%s
wl_output
wl_shm
weston_screenshooter
WAYLAND_SOCKET
%s must be launched by weston.
Use the MOD+S shortcut to take a screenshot.
failed to create display: %m
display doesn't support screenshooter
XDG_RUNTIME_DIR
creating a buffer file for %d B failed: %m
mmap failed: %m
done
shoot
/weston-shared-XXXXXX
;*3$"
GCC: (GNU) 7.2.0
.shstrtab
.interp
.note.ABI-tag
.hash
.dynsym
.dynstr
.gnu.version
.gnu.version_r
.rela.dyn
.rela.plt
.init
.text
.fini
.rodata
.eh_frame_hdr
.eh_frame
.init_array
.fini_array
.data.rel.ro
.dynamic
.got
.got.plt
.data
.bss
.comment
tc@box:/usr/local/lib/weston$

and snippets are
Use the MOD+S shortcut to take a screenshot
%s must be launched by weston.

so are you suggesting I borrow this lib file and inject into sway to see if it will work?

2) clients/screenshot.c

does not appear to be a part of weston-dev or wayland-dev according to my eyesight
« Last Edit: August 05, 2018, 05:51:41 AM by aus9 »

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6007
Re: Howto: take a screenshot on Weston
« Reply #8 on: August 05, 2018, 06:37:28 AM »
Hi aus9
... but on sway....running grabber.....the screen goes blank but the little box appears
pressing s then q shows a screenshot is grabbed but unfortunately its just a blank image or black image ...
I guess the window manager doesn't use X for its top level window so there's nothing to copy, at least as far as X is concerned.

Quote
In case I have made mistakes can I start a new thread for grabber? Or is imgur image proof that any mistakes are minor?
If the image matches what you tried to save, then it's probably right. There is a thread for  grabber  over here:
http://forum.tinycorelinux.net/index.php/topic,18412.msg112301.html#msg112301
It documents how  grabber  evolved and bugs were resolved. You can post over there if you wish.

Did the compiler issue a lot of warnings when you compiled for 64 bit?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 10204
Re: Howto: take a screenshot on Weston
« Reply #9 on: August 05, 2018, 06:39:04 AM »
I was suggesting that you look at the code in weston-screenshooter to see if it could be easily modified to use with another wayland wm

aus9

  • Guest
Re: Howto: take a screenshot on Weston
« Reply #10 on: August 05, 2018, 05:10:01 PM »
I lack the skills to take up Juanito's suggestion but  may not need to do that soonish

Forgive me for any perceived ego issues....but I repeat I have not learnt any computer languages eg python nor done any courses in coding so I have to call myself a simple coder in comparison to Juanito or Rich etc. but I am now retired at the tender age of 60 and enjoy the modest challenge of getting some packages to compile on TC, which is why I am back. I also practice slow breathing which has helped with some medical issues.

upstream the maintainer preferred distribution against git branch 0.15 that builds against wlc and chck.....and for various reasons I resisted building
----it had a screen capture exe called swaygrab
upstream there are alpha releases....the most recent is 1.0 alpha 4 which had no swaygrab, as that part of the function had not transistioned from wlc to wlroots.....and wlroots is the new dep of sway git stuff.

sway master now shows a new package called swaynab, which I am hoping means capture.

umm I find sway quite usable but it is still a WIP so I might have to delay any submission

cheers
« Last Edit: August 05, 2018, 05:21:27 PM by aus9 »

aus9

  • Guest
Re: Howto: take a screenshot on Weston
« Reply #11 on: August 05, 2018, 05:25:30 PM »
Rich

I will post over at your grabber thread with more details within 2 days. I may not be the best person to do the submisison but I will prepare a fresh script and some screenshots or code quotes that might assist you in seeing if any issues are minor or not.

thanks in advance