barrier/res/makeicon.sh

23 lines
737 B
Bash
Raw Permalink Normal View History

2018-02-03 00:12:14 +00:00
#!/bin/sh
2018-02-16 16:55:16 +00:00
ICNS_BASE=../dist/macos/bundle/Barrier.app/Contents/Resources
2018-02-03 00:12:14 +00:00
if ! which magick >/dev/null 2>&1; then
2021-09-22 20:43:29 +00:00
echo "Need ImageMagick for this"
2018-02-03 00:12:14 +00:00
exit 10
fi
2021-09-22 21:46:52 +00:00
cd "$(dirname "$0")" || exit $?
2018-02-03 00:12:14 +00:00
if [ ! -r barrier.png ]; then
echo "Use inkscape (or another vector graphics editor) to create barrier.png from barrier.svg first"
exit 10
fi
rm -rf work || exit $?
mkdir -p work || exit $?
2018-02-16 16:55:16 +00:00
for s in 16 24 32 48 64 128 256 512 1024; do
2021-09-22 21:46:52 +00:00
magick convert barrier.png -resize "${s}x${s}" -depth 8 "work/${s}.png" || exit $?
2018-02-03 00:12:14 +00:00
done
2018-02-16 16:55:16 +00:00
# windows icon
2018-02-03 00:12:14 +00:00
magick convert work/{16,24,32,48,64,128}.png barrier.png barrier.ico || exit $?
2018-02-16 16:55:16 +00:00
# macos icon
2021-09-22 21:46:52 +00:00
png2icns "$ICNS_BASE/Barrier.icns" work/{16,32,256,512,1024}.png || exit $?
2018-02-03 00:12:14 +00:00
rm -rf work
echo Done