Skip to content

Instantly share code, notes, and snippets.

@willmanduffy
Created December 19, 2023 21:39
Show Gist options
  • Select an option

  • Save willmanduffy/1a44b8d622e1573a830b6815848aae7d to your computer and use it in GitHub Desktop.

Select an option

Save willmanduffy/1a44b8d622e1573a830b6815848aae7d to your computer and use it in GitHub Desktop.
List to camera changes
#!/bin/bash
log stream --predicate 'subsystem == "com.apple.UVCExtension" and composedMessage contains "Post PowerLog"' | while read line; do
if echo "$line" | grep -q "= On"; then
echo "Camera has been activated."
fi
# If we catch a camera stop event, turn the light off.
if echo "$line" | grep -q "= Off"; then
echo "Camera has been deactivated."
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment