Skip to content

Instantly share code, notes, and snippets.

@rsms
Created June 4, 2017 23:01
Show Gist options
  • Select an option

  • Save rsms/a175cdb9f308aec26f4a476689937249 to your computer and use it in GitHub Desktop.

Select an option

Save rsms/a175cdb9f308aec26f4a476689937249 to your computer and use it in GitHub Desktop.
Extract PDFs for macOS cursors
#!/bin/bash
set -e
cd "$(dirname "$0")"
SRCDIR=$(pwd)
OUTDIR=$SRCDIR/cursors
mkdir -p "$OUTDIR"
cd /System/Library/Frameworks/ApplicationServices.framework/Frameworks/HiServices.framework/Resources/cursors
# if !(which pdf2svg); then
# echo "Missing pdf2svg (http://www.cityinthesky.co.uk/opensource/pdf2svg). Try: brew install pdf2svg"
# exit 1
# fi
for dir in *; do
if [[ -d $dir ]]; then
serialno=0
for file in $dir/*.pdf; do
echo "$dir"
cp "$file" "$OUTDIR/$dir.pdf"
# pdf2svg "$OUTDIR/$dir.pdf" "$OUTDIR/$dir.svg"
done
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment