Skip to content

Commit 6eee5c1

Browse files
committed
Allow Arc source to be downloaded externally
1 parent 34c449d commit 6eee5c1

File tree

1 file changed

+60
-15
lines changed

1 file changed

+60
-15
lines changed

solarize.sh

+60-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
11
#!/bin/bash
22

3-
# Github release to base from
4-
if [ -z $ARCVERSION ]; then
5-
ARCVERSION="20210127"
3+
# Directory that the pre-downloaded arc theme source can be located in
4+
ARC_DIRECTORY=
5+
# Whether or not to download arc
6+
ARC_NEED_DOWNLOAD=true
7+
# If downloading arc, which version to download (this should be the most recently validated version)
8+
if [ -z $ARC_VERSION ]; then
9+
ARC_VERSION="20210412"
610
fi
711

12+
usage()
13+
{
14+
echo "Calling this script with no arguments will download the most recently validated version \n"
15+
echo " of Arc theme and then process it. You can use --arc-version (or -v) to download a specific \n"
16+
echo " version of Arc theme, or use --arc-directory (or -d) to process a pre-downloaded Arc theme \n\n"
17+
echo "You may also see this message if you used invalid arguments. "
18+
}
19+
20+
while [ "$1" != "" ]; do
21+
case $1 in
22+
-d | --arc-directory ) shift
23+
ARC_DIRECTORY="$1"
24+
ARC_NEED_DOWNLOAD=false
25+
;;
26+
-v | --arc-version ) shift
27+
ARC_VERSION="$1"
28+
;;
29+
-h | --help ) usage
30+
exit
31+
;;
32+
* ) usage
33+
exit 1
34+
esac
35+
shift
36+
done
37+
838
# Arc colors
939
## SCSS
1040
A_BASE="404552"
@@ -196,20 +226,31 @@ REPLACE[$A_PLANK_FILL_END]="7;;54;;66;;255"
196226
REPLACE[$A_PLANK_OUTER_STROKE]="5;;18;;29;;255"
197227
REPLACE[$A_PLANK_INNER_STROKE]="0;;43;;54;;0"
198228

199-
# Pull the Arc source
200-
echo "### Downloading Arc source"
201-
wget --quiet "https://github.com/jnsh/arc-theme/releases/download/${ARCVERSION}/arc-theme-${ARCVERSION}.tar.xz"
202-
tar -xJf "arc-theme-${ARCVERSION}.tar.xz"
203-
rm "arc-theme-${ARCVERSION}.tar.xz"
229+
CWD="`pwd`/arc-theme"
230+
# Remove the arc-theme folder from a previous invocation of this script.
231+
rm -rf "${CWD}"
232+
233+
if [ "$ARC_NEED_DOWNLOAD" = true ] ; then
234+
# Delete the Arc source from previous script invocations
235+
rm -rf "`pwd`/arc-theme-${ARC_VERSION}"
204236

205-
CWD="`pwd`/arc-theme-${ARCVERSION}"
237+
# Pull the Arc source
238+
echo "### Downloading Arc source"
239+
wget --quiet "https://github.com/jnsh/arc-theme/releases/download/${ARC_VERSION}/arc-theme-${ARC_VERSION}.tar.xz"
240+
tar -xJf "arc-theme-${ARC_VERSION}.tar.xz"
241+
rm "arc-theme-${ARC_VERSION}.tar.xz"
242+
cp --recursive "`pwd`/arc-theme-${ARC_VERSION}" "${CWD}"
243+
else
244+
# Copy the arc source to the arc-theme folder so that the source can be reused if necessary
245+
echo "### Copying pre-downloaded Arc source"
246+
cp --recursive "${ARC_DIRECTORY}" "${CWD}"
247+
fi
206248
cd "${CWD}"
207249

208250
echo "### Applying patch(es)"
209251

210252
echo "### Optimising SVGs"
211-
find . -name "*.svg" -exec inkscape {} --vacuum-defs --export-plain-svg={} \;
212-
253+
find . -name "*.svg" -exec inkscape --actions="export-plain-svg;vacuum-defs" {} \;
213254
FILETYPES=('.scss' '.svg' '.xpm' '.xml' 'rc' '.theme')
214255

215256
echo "### Replacing arc colors with solarized colors"
@@ -226,8 +267,12 @@ done
226267
for PATTERN in "index.theme*" "metacity-theme-*.xml"; do
227268
find "${CWD}/common" -name "${PATTERN}" -exec sed -i "s/Arc/SolArc/g" {} \;
228269
done
229-
sed -i "s/Arc/SolArc/g" configure.ac;
230-
sed -i "s/Arc/SolArc/g" meson.options;
231-
232-
echo "### Patching complete! You may now run autogen.sh & make in arc-theme-${ARCVERSION} as you wish"
233270

271+
# Arc theme has fully switched to meson building as of version 20210412
272+
if [ -f "meson.build" ]; then
273+
sed -i "s/Arc/SolArc/g" meson.build;
274+
echo "### Patching complete! You may now run meson configure & meson install in arc-theme as you wish"
275+
else
276+
sed -i "s/Arc/SolArc/g" configure.ac;
277+
echo "### Patching complete! You may now run autogen.sh & make in arc-theme as you wish"
278+
fi

0 commit comments

Comments
 (0)