Created
January 13, 2021 09:55
-
-
Save normanrz/00bfd7bee7469381024ad470395d84f5 to your computer and use it in GitHub Desktop.
gitshots
This file contains hidden or 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
#!/bin/bash | |
# For adding automatic webcam shots on every commit | |
if [ ! -f .git/hooks/post-commit ]; then | |
echo "#!/bin/sh | |
snap $HOME/.gitshots/\$(date -u +"%Y-%m-%dT%H-%M-%SZ").jpg &" > .git/hooks/post-commit | |
chmod u+x .git/hooks/post-commit | |
echo "Post-commit hook added" | |
fi |
This file contains hidden or 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
#!/bin/bash | |
# Making a webcam shot | |
if [ -z ${1+x} ] | |
then | |
echo "Usage: `basename $0` <filename>" | |
exit 2 | |
fi | |
ffmpeg -y -loglevel quiet -f avfoundation -video_size 1280x720 -framerate 30 -i "0" -vframes 1 $1 > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment