@@ -8,12 +8,15 @@ ARC_NEED_DOWNLOAD=true
8
8
if [ -z $ARC_VERSION ]; then
9
9
ARC_VERSION=" 20210412"
10
10
fi
11
+ # Defaults to number of CPUs for multithreading the find/exec commands
12
+ JOBS=` nproc`
11
13
12
14
usage ()
13
15
{
14
16
echo " Calling this script with no arguments will download the most recently validated version \n"
15
17
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"
18
+ echo " version of Arc theme, or use --arc-directory (or -d) to process a pre-downloaded Arc theme \n"
19
+ echo " You may also use --jobs (or -j) to specify how many threads should be used during the build\n\n"
17
20
echo " You may also see this message if you used invalid arguments. "
18
21
}
19
22
@@ -26,6 +29,9 @@ while [ "$1" != "" ]; do
26
29
-v | --arc-version ) shift
27
30
ARC_VERSION=" $1 "
28
31
;;
32
+ -j | --jobs ) shift
33
+ JOBS=" $1 "
34
+ ;;
29
35
-h | --help ) usage
30
36
exit
31
37
;;
@@ -250,7 +256,7 @@ cd "${CWD}"
250
256
echo " ### Applying patch(es)"
251
257
252
258
echo " ### Optimising SVGs"
253
- find . -name " *.svg" -exec inkscape --actions=" export-plain-svg;vacuum-defs" {} \ ;
259
+ find . -name " *.svg" -print0 | xargs --null -P $JOBS -I % inkscape --actions=" export-plain-svg;vacuum-defs" % ;
254
260
FILETYPES=(' .scss' ' .svg' ' .xpm' ' .xml' ' rc' ' .theme' )
255
261
256
262
echo " ### Replacing arc colors with solarized colors"
259
265
echo " ## Replacing in ${filetype} "
260
266
for K in ${! REPLACE[@]}
261
267
do
262
- find . -type f -name " *${filetype} " -exec sed -i " s/${K} /${REPLACE[$K]} /Ig" {} \ ;
268
+ find . -type f -name " *${filetype} " -print0 | xargs --null -P $JOBS -I % sed -i " s/${K} /${REPLACE[$K]} /Ig" % ;
263
269
done
264
270
done
265
271
266
272
# Correct index.theme metadata & output directories
267
273
for PATTERN in " index.theme*" " metacity-theme-*.xml" ; do
268
- find " ${CWD} /common" -name " ${PATTERN} " -exec sed -i " s/Arc/SolArc/g" {} \ ;
274
+ find " ${CWD} /common" -name " ${PATTERN} " -print0 | xargs --null -P $JOBS -I % sed -i " s/Arc/SolArc/g" % ;
269
275
done
270
276
271
277
# Arc theme has fully switched to meson building as of version 20210412
0 commit comments