barrier/res/makeicon.sh

23 lines
736 B
Bash
Raw Normal View History

2018-02-03 03:12:14 +03:00
#!/bin/sh
2018-02-16 19:55:16 +03:00
ICNS_BASE=../dist/macos/bundle/Barrier.app/Contents/Resources
2018-02-03 03:12:14 +03:00
if ! which magick >/dev/null 2>&1; then
echo "Need ImageMagic for this"
exit 10
fi
2021-09-23 00:46:52 +03:00
cd "$(dirname "$0")" || exit $?
2018-02-03 03:12:14 +03: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 19:55:16 +03:00
for s in 16 24 32 48 64 128 256 512 1024; do
2021-09-23 00:46:52 +03:00
magick convert barrier.png -resize "${s}x${s}" -depth 8 "work/${s}.png" || exit $?
2018-02-03 03:12:14 +03:00
done
2018-02-16 19:55:16 +03:00
# windows icon
2018-02-03 03:12:14 +03:00
magick convert work/{16,24,32,48,64,128}.png barrier.png barrier.ico || exit $?
2018-02-16 19:55:16 +03:00
# macos icon
2021-09-23 00:46:52 +03:00
png2icns "$ICNS_BASE/Barrier.icns" work/{16,32,256,512,1024}.png || exit $?
2018-02-03 03:12:14 +03:00
rm -rf work
echo Done