bash script to run a command and take screenshot in every loop.

Couple of days back, I had posted a command to display a stop timer with bash and echo. There I had also put the following gif file:

\"bash

Here the tricky part was to capture the jpg\’s to create the gif file.

Preparation:

1. Rename the terminal to aka – amit-capture

2. Execute the command once with the import command and check the output and jpg\’s

3. Change the font size to 56 or 60 and resize the terminal before executing the command.

To to this I used the import command from the loop command to capture the terminal in every step of the loop.

Here is the full command:

1
2
3
4
5
6
7
clear

for i in `seq 100 -1 90`
do
echo -ne "$i   \\r"
sleep 1; import -window "aka - amit-capture" -resize 50% $i.jpg
done

For execution, just use history, it might be very difficult to type the full command again with small terminal and big fonts 🙂

\"Enhanced