forked from zotero/zotero-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-z-icons
executable file
·42 lines (34 loc) · 1.25 KB
/
make-z-icons
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
33
34
35
36
37
38
39
40
41
42
#!/bin/bash -e
#
# Generate platform-specific PNG files from SVG files for the main toolbar button
#
ROOT="$1"
SVG_ROOT="$ROOT/chrome/skin/default/zotero/zotero-z-32px-australis"
PLATFORM_PATH="$ROOT/chrome/content/zotero-platform"
if [ -z "$ROOT" ]; then
echo "Usage: $0 /path/to/zotero"
exit 1
fi
if [ ! -d "$ROOT" ]; then
echo "$1 is not a directory"
exit 1
fi
if [ ! -f "$SVG_ROOT-mac.svg" ]; then
echo "SVG file not found at $SVG-mac.svg"
exit 1
fi
# Mac
PLAT=mac
rm -f "$PLATFORM_PATH/$PLAT/"zotero-z-*-australis.png
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-16px-australis.png" -w 16 -h 16
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-32px-australis.png" -w 32 -h 32
# Windows
PLAT=win
rm -f "$PLATFORM_PATH/$PLAT/"zotero-z-*-australis.png
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-16px-australis.png" -w 16 -h 16
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-32px-australis.png" -w 32 -h 32
# Linux
PLAT=unix
rm -f "$PLATFORM_PATH/$PLAT/"zotero-z-*-australis.png
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-16px-australis.png" -w 16 -h 16
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-32px-australis.png" -w 32 -h 32