Keep this in a file named
imageme.sh in a folder any folder.
#!/bin/sh DATE=$(date "+%Y-%m-%d_%H-%M-%S") imagesnap -w 2.00 "$HOME/.loginimages/$DATE.jpg"
What the above script does is it creates a date string with year-month-day-hour-minute-second and now take a picture using
imagesnap and save it to your home directory.
-w 2.00is a wait time so as to make sure we get your photo.
You could download the binary from the above webpage or install using
brew install sleepwatcher
Now to actually run the script on wakeup.
Add this to file
#!/bin/bash # Run the following script on wakeup PATH=$PATH:/usr/local/bin /Users/$USER/.imagescript/imageme.sh
/Users/$USER/.imagescript/imageme.sh with the path to where you saved the
Take a nap. zzzz.