-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e26af81
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import notify2 | ||
from subprocess import check_output, STDOUT, CalledProcessError | ||
import os | ||
os.environ["PBR_VERSION"] = "4.0.2" | ||
from tendo import singleton | ||
me = singleton.SingleInstance() | ||
notify2.init("Spy Notify") | ||
while True: | ||
cmd = "fuser /dev/video0" | ||
try: | ||
usage = check_output(cmd, stderr=STDOUT, shell=True) | ||
returncode = 0 | ||
except CalledProcessError as ex: | ||
usage = ex.output | ||
returncode = ex.returncode | ||
if returncode != 1: | ||
raise | ||
if returncode == 0: | ||
img_path = "/opt/Spy Notify/image1.ico" | ||
notify2.Notification("Webcam in Use", message="Your webcam is being used! Is this you?", icon=img_path).show() | ||
use = True | ||
while use == True: | ||
try: | ||
usage = check_output(cmd, stderr=STDOUT, shell=True) | ||
returncode = 0 | ||
except CalledProcessError as ex: | ||
usage = ex.output | ||
returncode = ex.returncode | ||
if returncode != 1: | ||
raise | ||
if returncode != 0: | ||
use = False | ||
break |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import cv2 | ||
from subprocess import check_output, STDOUT, CalledProcessError, call | ||
cap = cv2.VideoCapture(0) | ||
try: | ||
cam1 = check_output("lsof | grep AppleCamera", stderr=STDOUT, shell=True) | ||
returncode1 = 0 | ||
except CalledProcessError as ex: | ||
cam1 = ex.output | ||
returncode1 = ex.returncode | ||
if returncode1 != 1: | ||
raise | ||
try: | ||
cam2 = check_output("lsof | grep iSight", stderr=STDOUT, shell=True) | ||
returncode2 = 0 | ||
except CalledProcessError as ex: | ||
cam2 = ex.output | ||
returncode2 = ex.returncode | ||
if returncode2 != 1: | ||
raise | ||
try: | ||
cam3 = check_output("lsof | grep VDC", stderr=STDOUT, shell=True) | ||
returncode3 = 0 | ||
except CalledProcessError as ex: | ||
cam3 = ex.output | ||
returncode3 = ex.returncode | ||
if returncode3 != 1: | ||
raise | ||
if cam1 == cam2: | ||
cmd = "lsof | grep VDC" | ||
elif cam1 == cam3: | ||
cmd = "lsof | grep iSight" | ||
elif cam2 == cam3: | ||
cmd = "lsof | grep AppleCamera" | ||
settings = open("/Library/Spy Notify/settings.txt","w") | ||
settings.write(cmd) | ||
settings.close() | ||
call("open -a Spy-Notify", shell=True) | ||
exit() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from win10toast import ToastNotifier | ||
import cv2 | ||
import os | ||
os.environ["PBR_VERSION"] = "4.0.2" | ||
from tendo import singleton | ||
me = singleton.SingleInstance() | ||
while True: | ||
notify = ToastNotifier() | ||
cap = cv2.VideoCapture(0) | ||
if cap.read() == (False, None): | ||
var = True | ||
else: | ||
var = False | ||
cap.release() | ||
if var != False: | ||
notify.show_toast("Webcam in Use","Your webcam is being used! Is this you?",icon_path="image1.ico",duration=10) | ||
use = True | ||
while use == True: | ||
cap = cv2.VideoCapture(0) | ||
if cap.read() != (False, None): | ||
use = False | ||
break |