Thursday, March 23, 2017

periodically capture screen of a program

1- create a nested display
$ Xephyr :7 -ac -screen 800x600

2- run the program that we want to the the screenshot of in that display,
example we display a random number every one second
$ DISPLAY=:7 aterm  -e watch -n 1 -x rand

3- finally the bash script to take the screenshot
while true
do
DISPLAY=:7 scrot
sleep 1
done


4-run the script then it will capture one snapshot every second.

No comments:

Post a Comment