-
-
Save extratone/551aa5c8644679377f0cb2acaf39cd6e to your computer and use it in GitHub Desktop.
Bash script for automatically capturing screenshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to use: | |
# ./screenshot-tool.sh [export directory] [seconds between screenshots] | |
# Example: ./screenshot-tool.sh ~/Pictures 5 | |
# Install scrot if it's not already installed | |
if ! [ -x "$(command -v scrot)" ]; then | |
sudo apt install -y scrot | |
fi | |
# Set directory to parameter $1 | |
cd "$1" | |
echo "Capturing a screenshot every $2 seconds." | |
echo "press CTRL-C to stop." | |
# Take a screenshot every $2 seconds of the current window | |
for (( ; ; )) | |
do | |
scrot '%Y-%m-%d_$wx$h.jpg' -q 70 -u | |
sleep "$2" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment