The script below will take screenshot of the entire screen forever using ImageMagick. It is useful when you also need to capture your mouse actions(e.g. mouse hover on options, mouse click on options, etc)
#!/bin/bash set -e # Description: Take screenshots of the entire screen on every second forever. # Useful when you also need to click on UI. # -q or -s is optional. They are used to disable the beep sound when screenshot is taken. no_beep=$1 while true; do # Wait for 1 second. sleep 1s output_filename=screenshot_$(date +%Y-%m-%d_%H.%M.%S).png # Whether to beep or not. if [ "${no_beep}" = "-q" ] || [ "${no_beep}" = "-s" ]; then magick import -silent -window root "${output_filename}" else magick import -window root "${output_filename}" fi echo "${output_filename}" done