I set up a automated kickstart-installation for a "digital-signage-client" based on Fedora 30 (soon 32), and I need to get an actual visual feedback what is on the screen right now. I tried to enable the Gnome-Remote-Desktop via commandline (see Enable Gnome Screen Sharing via Commandline?) but unfortunately I'm not able to.
So the new approach is, to take a screenshot (and copy it via scp). While I'm able to take a screenshot directly on the client via a gnome-terminal with gnome-screenshot
, I don't know how I can do this from remote. I also tried other tools like KDE Spectacle or Shutter but also without luck.
An Idea was to set a cronjob to take the screenshot:
$> crontab -e
1 * * * * gnome-screenshot
but this doesn't work eighter. journalctl _COMM=cron
says -- No entries --
Has someone an idea how I can take a screenshot from a Gnome-Wayland-Fedora Desktop? Should this work via crontab?
Best Answer
For Wayland
Based on information from n-tchen, Flameshot (in the Fedora repos) works well:
If you are connected via ssh, add
WAYLAND_DISPLAY=wayland-0
at the beginning of the above line.You can also use
gnome-screenshot
instead of Flameshot, but you'll still need the above addition for ssh.Additional information (source):
Finally, Pyscreenshot supports Wayland; see the GitHub README
For X11
The
import
command from ImageMagick does a great job of screenshots:If you are connected via ssh, add
DISPLAY=:0.0
at the beginning of the above line, and you'll need to be logged in as the same user that is logged in locally.If you want to run this in crontab, here is how to set it up. This will take a screenshot every 6 minutes and store it with a date-time-encoded filename in
/root/monitor/
. It has been tested on Ubuntu 16.04 and 18.04.