Skip to content

Instantly share code, notes, and snippets.

@lesp
Created May 20, 2022 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesp/44a964f314548009c3912a18c69b5d21 to your computer and use it in GitHub Desktop.
Save lesp/44a964f314548009c3912a18c69b5d21 to your computer and use it in GitHub Desktop.
Simon says...take a screenshot every minute and use the timestamp as the filename
#!/bin/bash
current_time=$(date "+%Y.%m.%d-%H.%M.%S")
echo "Current Time : $current_time"
scrot -d 60 "${current_time}.png"
@lesp
Copy link
Author

lesp commented May 20, 2022

Install scrot
sudo apt install scrot
Save the file as capture.sh.
Run the code using
bash capture.sh

@lesp
Copy link
Author

lesp commented May 20, 2022

#!/bin/bash
while true
do
  current_time=$(date "+%Y.%m.%d-%H.%M.%S")
  echo "Current Time : $current_time"
  scrot -d 60 "${current_time}.png"
done

@lesp
Copy link
Author

lesp commented May 20, 2022

That will make it loop FOREVER and EVER!
Press CTRL + C to stop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment