Is there a program to do following: I have a webcam on my laptop. I would like that my computer starts a screensaver if I'm not watching my laptop and stop the saver when I'm watching the screen. Is there a program for reading the webcam? I'm using Ubuntu 14.04.
From the sound of this blog post you can use the project
shantz-locker.sh to do what you want.
The post includes everything you need. The 2 pieces are the use of the
motion application which is typically available in most repos such as Fedora and/or Ubuntu, and the shell script that's attached to the above article, shantz-webcam-locer.zip.
NOTE: I've also posted the script on pastebin.com here, in case the original ever goes away.
./shantz-locker [-l <LockThreshold>] [-u UnlockThreshold] [-s LockScanInterval] [-t UnlockScanInterval]
LockThreshold– Determines the threshold (based on no. of samples sans motion) to lock your PC. Default is 5
UnlockThreshold– Determines the threshold (based on no. of samples with motion) to unlock your PC. Default is 2
LockScanInterval– How soon to check if there is motion when your PC is in unlocked state. Default interval is 5 seconds
UnlockScanInterval– How soon to check if there is motion when your PC is in locked state. Default interval is 2 seconds
The ZIP file contains only 2 files, a sample
motion.conf file along with the script,
$ unzip -l shantz-webcam-locker.zip Archive: shantz-webcam-locker.zip Length Date Time Name --------- ---------- ----- ---- 0 08-10-2008 12:11 shantz-webcam-locker/ 22115 08-10-2008 10:57 shantz-webcam-locker/motion.conf 2954 08-10-2008 11:32 shantz-webcam-locker/shantz-locker.sh --------- ------- 25069 3 files