forked from JulienMaille/dribbblish-dynamic-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
70 lines (57 loc) · 2.24 KB
/
install.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
#!/bin/sh
# Copyright 2019 khanhas. GPL license.
# Edited from project Denoland install script (https://github.com/denoland/deno_install)
set -e
if [ $# -eq 0 ]; then
latest_release_uri="https://api.github.com/repos/JulienMaille/dribbblish-dynamic-theme/releases/latest"
echo "DOWNLOADING $latest_release_uri"
version=$( command curl -sSf "$latest_release_uri" |
command grep -Eo "tag_name\": .*" |
command grep -Eo "[0-9.]+" )
download_uri=$( command curl -sSf "$latest_release_uri" |
command grep -Eo "browser_download_url\": .*" |
command grep -Eo "http.*?\.zip" )
if [ ! "$version" ]; then exit 1; fi
else
version="${1}"
fi
spicetify_install="${SPICETIFY_INSTALL:-$HOME/spicetify-cli/Themes}"
if [ ! -d "$spicetify_install" ]; then
echo "MAKING FOLDER $spicetify_install";
mkdir -p "$spicetify_install"
fi
tar_file="$spicetify_install/${version}.zip"
echo "DOWNLOADING v$version $download_uri"
curl --fail --location --progress-bar --output "$tar_file" "$download_uri"
cd "$spicetify_install"
echo "EXTRACTING $tar_file"
unzip -d "$spicetify_install/dribbblish-dynamic-theme-${version}" -o "$tar_file"
echo "REMOVING $tar_file"
rm "$tar_file"
# Check ~\.spicetify.\Themes directory already exists
sp_dot_dir="$(dirname "$(spicetify -c)")/Themes/DribbblishDynamic"
if [ ! -d "$sp_dot_dir" ]; then
echo "MAKING FOLDER $sp_dot_dir";
mkdir -p "$sp_dot_dir"
fi
echo "COPYING"
cp -rf "$spicetify_install/dribbblish-dynamic-theme-${version}/." "$sp_dot_dir"
echo "INSTALLING"
cd "$(dirname "$(spicetify -c)")/Themes/DribbblishDynamic"
mkdir -p ../../Extensions
cp dribbblish-dynamic.js ../../Extensions/.
spicetify config extensions default-dynamic.js- extensions dribbblish.js- extensions Vibrant.min.js- extensions dribbblish-dynamic.js
spicetify config current_theme DribbblishDynamic
spicetify config color_scheme base
spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
echo "PATCHING"
PATCH='[Patch]
xpui.js_find_8008 = ,(\\w+=)32,
xpui.js_repl_8008 = ,\${1}58,'
if cat config-xpui.ini | grep -o '\[Patch\]'; then
perl -i -0777 -pe "s/\[Patch\].*?($|(\r*\n){2})/$PATCH\n\n/s" config-xpui.ini
else
echo -e "\n$PATCH" >> config-xpui.ini
fi
echo "APPLYING"
spicetify apply