dotfiles/cron/webcam.sh

15 lines
390 B
Bash
Raw Normal View History

2017-01-27 21:31:32 +01:00
#!/bin/bash
## 0 * * * * ~/.dotfiles/cron/webcam.sh
2017-01-27 21:31:32 +01:00
now=$(date +"%Y_%m_%d_%H_%M_%S")
path="$HOME/Pictures/hour-pics"
2017-01-27 21:31:32 +01:00
size="1280x720"
basename=$(dirname $(readlink -f $0))
2017-01-27 21:31:32 +01:00
mkdir -p $path
streamer -q -f jpeg -s $size -o $path/$now.jpeg -r 1
grey="$(python3 $basename/blackcheck.py -i $path/$now.jpeg -d 10)"
2017-01-27 21:31:32 +01:00
if [ "$grey" = "True" ] ; then
mv $path/$now.jpeg $path/black/$now.jpeg
2017-01-27 21:31:32 +01:00
fi
exit 0