-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmake-icons.sh
More file actions
executable file
·32 lines (24 loc) · 692 Bytes
/
Copy pathmake-icons.sh
File metadata and controls
executable file
·32 lines (24 loc) · 692 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Usage: ./make_icon.sh icon_name
# Requires: inkscape, imagemagick (convert)
set -e
if [ -z "$1" ]; then
echo "Usage: $0 icon_name"
exit 1
fi
#convert -density 300 $1.svg -define icon:auto-resize="16,32,48,64,128,256,512" $1.ico
ICON_NAME="$1"
SIZES=(16 32 48 64 128 256 512)
rm -f tmp_${ICON_NAME}_*.png
echo -n "Generating "
for SIZE in "${SIZES[@]}"; do
echo -n "$SIZE "
inkscape "${ICON_NAME}.svg" \
--export-type=png \
--export-filename="tmp_${ICON_NAME}_${SIZE}.png" \
-w $SIZE -h $SIZE
done
echo -n ", creating ${ICON_NAME}.ico..."
convert tmp_${ICON_NAME}_*.png "${ICON_NAME}.ico"
rm -f tmp_${ICON_NAME}_*.png
echo "done."