During my work, I often try out tools of different complexity and develop usage and integration scenarios.
I use Ubuntu 18.04 LTS.
Sometimes if things get really complicated, I am not always sure how exactly I got to the solution, and for documentation and knowledge sharing purposes I spend additional time to become more aware of a neat and clean way with less messing around, take screenshots and so on.
Then I thought it would be great to have a screen capturing tool to take a picture say every 30 seconds silently in background so that I can:
- Easily recap my steps and also gotchas
- If I am lucky, directly use screenshots from this image archive for the documentation.
I thought I would, for example, configure a cronjob for shutter, but while I am already using it, there is an error "you have already shutter instance running". I will try now with scrot.
Any better ideas?
UPDATE: For the Cron managed execution, as this tool can't resolve time intervals less than one minute, here a solution (on of less rated answers in the thread) for every 30 seconds.
* * * * * /bin/bash -l -c "/path/to/executable; sleep 30 ; /path/to/executable"
I have just started learning Ubuntu.
I don't know this method is proper or not.
I Could achieve it in the below way.
I have created a script like this named ScreenShot.sh in the folder /usr/local/bin
sudo chmod a+x /usr/local/bin/ScreenShot.sh
when i start the system and wanted to start the screen capture at every 10secs,
i run this command
sudo watch -n 10 ScreenShot.sh
i have configured my default folder, image type to be saved, with dconf editor in
gnome-screenshot
section.Sounds are stopped by dconf settings under sound section
I do the same thing. This is the script that I wrote, called
screenlog-capture
:Some of the interesting features:
scrot
to take screenshots.puzzle-diff
to skip saving a screenshot if it would be the same as the previous one (with some tolerance).I use another shell script,
screenlog
, to call this one periodically:I came up with
I have
~/bin
and so I saved this script there ascontinuous-scrot.sh
and made it executable. To run it, I open a terminal window and type the name of the script and press Enter. I leave this terminal window active and full-screen screenshots are captured every 30s in your~/Pictures
folder. To stop, just go back to this terminal window and press Ctrl+C.Since I have many linux distributions where I need screenshots, and they use various window managers I use probably the oldest of screenshot utilities xwd. It is a part of XServer distribution, so I can be sure it is installed every time. I am not sure if it is distributed and if it works with wayland. The command
should make a screenshot of root window of display :0.0. The output file is a special formatted dump file. ImageMagick can convert that file to some more common format. For more information: https://linux.die.net/man/1/xwd.
You can find many ideas how to run such utility on regular intervals in other answers. To make output to a different file every time you could do:
The first thing I can think about is to open a terminal and use it to issue scrot within a while with a sleep. Something like this:
To me, there's a catch in this. What if you make something significant between the 30 secs interval? Have you considered a screen recorder (SimpleScreenRecorder is one available on ubuntu distribution. another name I recall is Istanbul)
I'd use
recordmydesktop
, possibly with a low fps rate and no audio to reduce the amount of data recorded.While these are not exactly screenshots, but a full video, the advantage is that you get good compression as only differences between consecutive images need to be saved, you have the option of also recording your microphone so you can take notes by speaking, and you can optionally add start/stop buttons to the system notification area.
How I solved this for myself:
First, install the following cronjob:
Notice the
DISPLAY=:0
statement to allow cron to access the X Server.Then, create
~/bin/create-screenshot.sh
with the following contents: