-
Notifications
You must be signed in to change notification settings - Fork 4
/
autogen.sh
executable file
·169 lines (134 loc) · 4.29 KB
/
autogen.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/bin/bash
WORKDIR="$PWD/src"
OUTDIR="$PWD"
# sassc check
[ ! -f "/usr/bin/sassc" ] && echo "sassc is not installed, or not found at '/usr/bin/sassc'" && exit 1
# remove previous generation
for d in ./*
do
[ -d $d/Azurra ] && continue
[ -d $d ] && rm -r $d
done
cd $WORKDIR
INDEX=$WORKDIR/variant-index
RENDER=false
GEN=true
gen_index() {
target="$1"
name="$2"
series="$3"
echo "[Desktop Entry]
Type=X-GNOME-Metatheme
Name=$name
Comment=$series, a redesigned modern & flat theme with modern colors. Originally by RAVEfinity.com, now maintained by Elbullazul
Encoding=UTF-8
Name[en_CA]=index-aqua.theme
[X-GNOME-Metatheme]
GtkTheme=Ambiance-Flat-Aqua
MetacityTheme=Ambiance-Flat-Aqua
IconTheme=Vibrancy-Full-Dark-Aqua
CursorTheme=DMZ-White
ButtonLayout=close,minimize,maximize:" >> "$target"
}
while [ "$1" != "" ]; do
case $1 in
-c | --clean)
for i in `cat $INDEX`; do
rm -rf ../src/gtk-3.0/$i/assets-render/assets/*
rm -rf ../src/gtk-3.0/$i/assets-render-dark/assets/*
done
exit
;;
-r | --render)
RENDER=true
;;
-n | --no-gen)
GEN=false
;;
-h | --help)
echo " -h --help Show this"
echo " -c --clean Remove previously rendered assets"
echo " -r --render Force run image generation script (much verbose!)"
echo " -n --no-gen Do not generate SASS"
exit
;;
esac
shift
done
#gtk2
cd gtk-2.0
for i in `cat $INDEX`
do
VARIANT=Ambiance-Flat-${i^}
LIGHT_VARIANT=Radiance-Flat-${i^}
DARK_VARIANT=Ambiance-Blackout-Flat-${i^}
mkdir -p $OUTDIR/$VARIANT/gtk-2.0
mkdir -p $OUTDIR/$LIGHT_VARIANT/gtk-2.0
mkdir -p $OUTDIR/$DARK_VARIANT/gtk-2.0
cp -r img $OUTDIR/$VARIANT/gtk-2.0/
cp -r img $OUTDIR/$LIGHT_VARIANT/gtk-2.0/
cp -r img $OUTDIR/$DARK_VARIANT/gtk-2.0/
cp -r apps $OUTDIR/$VARIANT/gtk-2.0/
cp -r apps $OUTDIR/$LIGHT_VARIANT/gtk-2.0/
cp -r apps $OUTDIR/$DARK_VARIANT/gtk-2.0/
cp main.rc $OUTDIR/$VARIANT/gtk-2.0/
cp main-light.rc $OUTDIR/$LIGHT_VARIANT/gtk-2.0/main.rc
cp main-dark.rc $OUTDIR/$DARK_VARIANT/gtk-2.0/main.rc
cp gtkrc-$i $OUTDIR/$VARIANT/gtk-2.0/gtkrc
cp gtkrc-$i-light $OUTDIR/$LIGHT_VARIANT/gtk-2.0/gtkrc
cp gtkrc-$i-dark $OUTDIR/$DARK_VARIANT/gtk-2.0/gtkrc
done
cd ..
# gtk3
cd gtk-3.0
for i in `cat $INDEX`
do
VARIANT=Ambiance-Flat-${i^}
LIGHT_VARIANT=Radiance-Flat-${i^}
DARK_VARIANT=Ambiance-Blackout-Flat-${i^}
mkdir -p $OUTDIR/$VARIANT/gtk-3.0
mkdir -p $OUTDIR/$LIGHT_VARIANT/gtk-3.0
mkdir -p $OUTDIR/$DARK_VARIANT/gtk-3.0
cd $i
if [ $GEN == true ]; then
echo "Running SASS for ${i^}"
sassc -M gtk.scss gtk.css
sassc -M gtk-dark.scss gtk-dark.css
sassc -M gtk-light.scss gtk-light.css
fi
cp gtk.css $OUTDIR/$VARIANT/gtk-3.0/gtk.css
cp gtk-dark.css $OUTDIR/$VARIANT/gtk-3.0/gtk-dark.css
cp gtk-light.css $OUTDIR/$VARIANT/gtk-3.0/gtk-light.css
cp gtk-light.css $OUTDIR/$LIGHT_VARIANT/gtk-3.0/gtk.css
cp gtk-dark.css $OUTDIR/$DARK_VARIANT/gtk-3.0/gtk.css
if [ $RENDER == true ]; then
(cd assets-render && ./render-assets.sh)
(cd assets-render-dark && ./render-assets.sh)
cp -r assets-render/assets/* assets
cp -r assets-render-dark/assets/* assets-dark
fi
cp -a assets-render/assets $OUTDIR/$VARIANT/gtk-3.0/assets
cp -a assets-render/assets $OUTDIR/$LIGHT_VARIANT/gtk-3.0/assets
cp -a assets-render-dark/assets $OUTDIR/$DARK_VARIANT/gtk-3.0/assets
cd ..
done
cd ..
# static files
for i in `cat $INDEX`
do
VARIANT=Ambiance-Flat-${i^}
LIGHT_VARIANT=Radiance-Flat-${i^}
DARK_VARIANT=Ambiance-Blackout-Flat-${i^}
cp -a metacity-1/$i $OUTDIR/$VARIANT/metacity-1
cp -a metacity-1/$i-light $OUTDIR/$LIGHT_VARIANT/metacity-1
cp -a metacity-1/$i-dark $OUTDIR/$DARK_VARIANT/metacity-1
cp -a unity/$i $OUTDIR/$VARIANT/unity
cp -a unity/$i-light $OUTDIR/$LIGHT_VARIANT/unity
cp -a unity/$i-dark $OUTDIR/$DARK_VARIANT/unity
cp -a xfwm4/$i $OUTDIR/$VARIANT/xfwm4
cp -a xfwm4/$i-light $OUTDIR/$LIGHT_VARIANT/xfwm4
cp -a xfwm4/$i-dark $OUTDIR/$DARK_VARIANT/xfwm4
gen_index $OUTDIR/$VARIANT/index.theme $VARIANT 'Ambiance-Flat'
gen_index $OUTDIR/$LIGHT_VARIANT/index.theme $LIGHT_VARIANT 'Radiance-Flat'
gen_index $OUTDIR/$DARK_VARIANT/index.theme $DARK_VARIANT 'Ambiance-Blackout-Flat'
done