-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild
executable file
·70 lines (57 loc) · 1.73 KB
/
build
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
#!/usr/bin/env bash
# Volantes cursors, based on KDE Breeze
# Copyright (c) 2016 Keefer Rourke <[email protected]>
# Copyright (c) 2020 Sergei Eremenko <https://github.com/SmartFinn>
set -eu
build_svgs() {
local src_dir="$1"
if [[ -n "$2" ]]; then
flavour="-f $2"
fi
for file in $src_dir/templates/*.tera; do
[ -f "$file" ] || continue
whiskers $file $flavour
done
}
SCRIPT_DIR="$(dirname "$0")"
SRC_DIR="$SCRIPT_DIR/src"
OUT_DIR="$SCRIPT_DIR/dist"
PNG_DIR="$SCRIPT_DIR/pngs"
SVGS_DIR="$SCRIPT_DIR/svgs"
HL_DIR="$SCRIPT_DIR/hl"
AUTHORS="$SCRIPT_DIR/AUTHORS"
LICENSE="$SCRIPT_DIR/LICENSE"
ACCENTS="blue dark flamingo green lavender light maroon mauve peach pink red rosewater sapphire sky teal yellow"
while getopts "f:a:" option; do
case $option in
f)
FLAVOR="$OPTARG"
;;
a)
ACCENTS="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG"
exit 1
;;
esac
done
echo "[INFO] - Flavor: '$FLAVOR'"
echo "[INFO] - Accent(s): '$ACCENTS'"
echo "[INFO] - Generating SVGs..."
build_svgs $SRC_DIR $FLAVOR
echo "[INFO] - Generating SVGs complete."
echo "[INFO] - Building cursor formats; xcursor, hyprcursor, plasmasvg..."
for accent in $ACCENTS; do
theme_name="catppuccin-$FLAVOR-$accent-cursors"
theme_src_dir="$SVGS_DIR/$theme_name"
theme_out_dir="$OUT_DIR/$theme_name"
theme_png_dir="$PNG_DIR/$theme_name"
theme_hl_dir="$HL_DIR/$theme_name"
scripts/build-cursors "$theme_src_dir" "$theme_png_dir" "$theme_hl_dir" "$theme_out_dir"
cp -f "$AUTHORS" "$theme_out_dir"
cp -f "$LICENSE" "$theme_out_dir"
cp -f "$theme_src_dir/index.theme" "$theme_out_dir"
cp -f "$theme_hl_dir/manifest.hl" "$theme_out_dir"
done
echo "[INFO] - Finished building cursor formats; xcursor, hyprcursor, plasmasvg"