Add bin/mac scripts

This commit is contained in:
Henrik Lissner 2016-10-19 21:40:09 +02:00
parent 9ba43fdeb5
commit 15958114cd
4 changed files with 41 additions and 0 deletions

15
bin/mac/html2pdf.sh Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Converts an html file (or website) to a pdf. It installs
# the dependencies if they aren't available.
#
# Note: MAC ONLY!
if ! command -v "wkhtmltopdf" &> /dev/null
then
# wkhtmltopdf > 0.9.9 has a habit of hanging after it completes, so we
# install 0.9.9 explicitly instead.
brew install https://raw.github.com/mxcl/homebrew/6e2d550cf4961129a790bfb0973f8e88704f439d/Library/Formula/wkhtmltopdf.rb
fi
wkhtmltopdf "$1" "$2"

5
bin/mac/run-boris.sh Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Mac-only: run boris REPL with homebrewed PHP
/usr/local/bin/php /usr/local/bin/boris

18
bin/mac/timelapse.sh Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Start taking screenshots every N seconds, until this script is
# called again.
if [ ! -f ~/.ss ]; then
dir="$1"
if [ $# -eq 0 ]; then
[ ! -d ~/Desktop/ss ] && mkdir -p ~/Desktop/ss
dir=~/Desktop/ss
fi
echo "$dir" > ~/.ss
echo "Timelapse, go!"
i=1;while [ -f ~/.ss ];do screencapture -t jpg -x "$dir/$i.jpg"; let i++;sleep 5; done &
else
echo "Deactivating timelapse! Images in: $(cat ~/.ss)/"
rm ~/.ss
fi

3
bin/mac/timelapse2mov.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
ffmpeg -r 24 -i %d.jpg -b 16000k $1