Detect Last Camera Access With Geektool

Is your iSight camera engaged? Are you sure the LED comes on every time? It doesn’t.

Using Geektool on a Mac you can check the last time the regular camera module (iSight) was access using this script in a GeekTool glet:

# Detect remote camera
# Colors
end="\x1b[0m"
bold="\x1b[001m"
underscore="\x1b[004m"
red="\x1b[031m"
green="\x1b[032m"
yellow="\x1b[033m"
STRINGA="`ls -lu /System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC | awk '{print $6, $7, $8}'`";
B="`date "+%b %d %H:%M"`";
if [ "$STRINGA" != "$B" ];then
 echo "\t✅ ${STRINGA}"
else
 echo "\t? ACTIVE!"
 afplay /Users/Shared/alert07.mp3;
 /usr/bin/osascript <<-EOF
tell application "The iSight Camera was activated at ${STRINGA}"
 activate
 display dialog "Hello world"
 end tell

EOF
fi

Point to the mp3 of your choice. This will show false positives when the device is just polled so be aware not every ping is a break in.

Based on this detector script, the script will display an alert during the first minute detected and put up an alert in case you were away. Lots of room for improvement on this one. Please let me know what you do with it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.