Skip to content

Instantly share code, notes, and snippets.

@arminrosu
Last active August 22, 2022 20:57
Show Gist options
  • Save arminrosu/af1ad5c331a890e52f744ad6788b896c to your computer and use it in GitHub Desktop.
Save arminrosu/af1ad5c331a890e52f744ad6788b896c to your computer and use it in GitHub Desktop.
Take iSight image and save to path
#!/bin/bash
# `brew install imagesnap` required
FILE_NAME=$(date +"%Y-%m-%d_%H-%M-%S.png")
FILE_DIR="/Users/[username]/Library/CloudStorage/GoogleDrive-[email]@gmail.com/My Drive/Photos/selfies/daily/$(date +"%Y/%m")"
echo $FILE_NAME
echo $FILE_DIR
mkdir -p "$FILE_DIR"
# Wait 2s for the camera to warm up
# Use absolute path
/usr/local/bin/imagesnap -q -w 2 "$FILE_DIR/$FILE_NAME"
@arminrosu
Copy link
Author

arminrosu commented Mar 18, 2021

Trigger script via EventScripts on these events:

  • Screen did wake
  • Screensaver stopped (will trigger with Screen password unlocked)
  • Screen password unlocked (doesn't require a screensaver password lock to trigger, ie. "password" is optional)

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