-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild-just-dark.sh
63 lines (52 loc) · 1.33 KB
/
build-just-dark.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
#2020 by Rizal Muttaqin
if ! command -v optipng >/dev/null
then
echo "Please install optipng"
exit 1
fi
if ! command -v svgcleaner >/dev/null
then
echo "Please install svgcleaner"
exit 1
fi
echo "=> Remove old both light and dark version"
rm -Rf "images_breeze_dark"
cp "images_breeze_dark/links.txt" \
"images_breeze_dark_svg"
cd "images_breeze_dark_svg"
echo "=> Clean SVG files ..."
find -name "*.svg" -o -name "*.SVG" | while read i;
do
echo "This $i file is compressed"
fname=$( basename "$i")
# echo "has the name: $fname"
fdir=$( dirname "$i")
# echo "and is in the directory: ${fdir##*/}"
svgcleaner "$i" "${i%.*}.svg"
done
cd "./.."
cp -Rf "images_breeze_dark_svg" \
"images_breeze_dark"
rm "images_breeze_dark_svg/links.txt"
cd "images_breeze_dark"
echo "=> 1. Breeze PNG (dark) version"
echo "=> Export dark SVG to PNG ..."
find -name "*.svg" -o -name "*.SVG" | while read i;
do
echo "This $i file is compressed"
fname=$( basename "$i")
# echo "has the name: $fname"
fdir=$( dirname "$i")
# echo "and is in the directory: ${fdir##*/}"
inkscape -f "$i" -e "${i%.*}.png"
optipng -o7 "${i%.*}.png"
#convert "$i" -quality 75 "$i"
done
echo "=> Delete dark SVG files ..."
find -name "*.svg" -o -name "*.SVG" | while read i;
do
fname=$( basename "$i")
fdir=$( dirname "$i")
rm "$i"
done