Last active
April 21, 2016 23:10
-
-
Save RoxasShadow/c23849767fa2b842d41a4cf8000c3950 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while :; do | |
currentOwner=$(lsof | grep -i VDC | awk -F '[^[:alnum:]]' '{print $NR}') | |
if [[ "$currentOwner" == "" && "$previousOwner" != "" && "$currentOwner" != "$previousOwner" ]]; then | |
previousOwner="" | |
osascript -e "display notification \"Camera deactivated\" with title \"Apple Camera\"" | |
elif [ "$previousOwner" != "$currentOwner" ]; then | |
previousOwner=$currentOwner | |
osascript -e "display notification \"Camera activated by $currentOwner\" with title \"Apple Camera\"" | |
fi | |
sleep 7 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment