This repository was archived by the owner on Feb 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·160 lines (149 loc) · 6.11 KB
/
install.sh
File metadata and controls
executable file
·160 lines (149 loc) · 6.11 KB
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
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
rose="\033[38;2;237;135;150m"
orange="\033[38;2;245;169;127m"
peach="\033[38;2;238;212;159m"
green="\033[38;2;166;218;149m"
blue="\033[38;2;125;196;228m"
pink="\033[38;2;198;160;246m"
white="\033[38;2;255;255;255m"
function welcome() {
echo -e "${rose} ⠀⠀⠀⠀⠀⠀⠀⠀⣀⣤⣴⣶⣶⣿⣿⣿⣿⣷⣶⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀"
echo -e "${orange}⠀⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⠀⠀⠀⠀⠀⠀"
echo -e "${peach}⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⢿⣿⣿⣷⣄⠀⠀⠀⠀"
echo -e "${green}⠀⠀⢠⣾⣿⣿⠀⠀⠀⠉⠛⢿⣿⠿⠿⠿⠿⠿⢿⠟⠁⠀⠀⠀⢿⣿⣿⣿⣷⡀⠀⠀"
echo -e "${blue}⠀⢠⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⡄⠀"
echo -e "${pink}⢀⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⣿⣿⣿⣿⣿⣷⠀"
echo -e "${rose}⢸⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀${white}⣠⣶⠶⣶⡄⠀⠀⢠⠾⠿⠶⡄⠀${rose}⠈⢿⣿⣿⣿⣿⡇"
echo -e "${orange}⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀${white}⠋⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀${orange}⠘⣿⣿⣿⣿⣷"
echo -e "${peach}⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${pink}⠘⠻⠟⠀⠀⠀⠀⠀⠀⠀${peach}⣿⣿⣿⣿⡿"
echo -e "${green}⢹⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀${white}⠐⠦⠴⠓⠚⠀⠀⠀⠀⠀${green}⢠⣿⣿⣿⣿⡇"
echo -e "${blue}⠈⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⡿⠀"
echo -e "${pink}⠀⠘⣿⣿⣿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⣿⠃⠀"
echo -e "${rose}⠀⠀⠘⢿⣿⣿⣿⣿⣦⠀⠀⠀⠀⠀⠀⠀⢠⣀⡀⣀⡀⠀⢰⣿⣿⣿⣿⣿⡿⠁⠀⠀"
echo -e "${orange}⠀⠀⠀⠀⠻⣿⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀${rose}⠸⣿⠟⠻⠇⠀⠀⣿⣿⣿⡿⠋⠀⠀⠀⠀"
echo -e "${peach}⠀⠀⠀⠀⠀⠀⠙⠿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠟⠋⠀⠀⠀⠀⠀⠀${white}"
echo
echo "Welcome to Catppuccin for steam!"
echo "Let's get your theme set up :3 "
echo
}
function install-theme() {
flavors=(
'frappe'
'latte'
'mocha'
'macchiato'
)
PS3="Please select a flavor (TIP: You can input a number if you'd like): "
select opt in "${flavors[@]}"; do
if [[ -n $opt ]]; then
break
else
echo "Please input a valid flavor!"
fi
done
steamdirs=(
"$HOME/.steam"
"$HOME/.var/app/com.valvesoftware.Steam/.steam/"
)
for dir in "${steamdirs[@]}"; do
if [ -d "$dir" ]; then
read -p "Would you like to remove any previous installation of Catppuccin? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -fr "$dir/steam/skins/Catppuccin-"*
fi
cd "$(mktemp -d)"
mkdir -p "$dir/steam/skins/Catppuccin-$opt"
install_path="$dir/steam/skins/Catppuccin-$opt"
git clone https://github.com/minischetti/metro-for-steam "$install_path"
git clone https://github.com/redsigma/UPMetroSkin
cp -r UPMetroSkin/"Unofficial 4.x Patch"/"Main Files [Install First]"/* "$install_path"
curl --url "https://raw.githubusercontent.com/catppuccin/steam/main/themes/$opt/resource/webkit.css" -o "$install_path/resource/webkit.css"
curl --url "https://raw.githubusercontent.com/catppuccin/steam/main/themes/$opt/custom.styles" -o "$install_path/custom.styles"
echo "Thanks for installing Catppuccin $opt for Steam :3"
break
else
echo "Sorry, i couldn't find your steam installation."
echo "Please input the path to your steam install"
echo "e.g. $HOME/steam"
read -r -p "==> " steam
read -p "Would you like to remove any previous installation of Catppuccin? [y/n] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -fr "$steam/steam/skins/[cC]atppuccin-"*
fi
cd "$(mktemp -d)"
mkdir -p "$steam/steam/skins/Catppuccin-$opt"
install_path="$steam/steam/skins/Catppuccin-$opt"
git clone https://github.com/minischetti/metro-for-steam "$install_path"
git clone https://github.com/redsigma/UPMetroSkin
cp -r UPMetroSkin/"Unofficial 4.x Patch"/"Main Files [Install First]"/* "$install_path"
curl --url "https://raw.githubusercontent.com/catppuccin/steam/main/themes/$opt/resource/webkit.css" -o "$install_path/resource/webkit.css"
curl --url "https://raw.githubusercontent.com/catppuccin/steam/main/themes/$opt/custom.styles" -o "$install_path/custom.styles"
echo "Thanks for installing Catppuccin $opt for Steam :3"
fi
done
}
declare -A install_command
dependencies=("curl" "git")
install_command=(
["apt-get"]="sudo apt-get install"
["dnf"]="sudo dnf install"
["emerge"]="sudo emerge -a"
["nix-shell"]="nix-shell -p"
["pacman"]="sudo pacman -S"
["cave"]="cave resolve"
["apk"]="apk add"
["xbps-install"]="xbps-install"
["brew"]="brew install"
)
function check_dependencies() {
local pm="$1"
local missing=()
for package in "${dependencies[@]}"; do
if ! command -v "$package" &>/dev/null; then
missing+=("$package")
fi
done
if [ "${#missing[@]}" -gt 0 ]; then
echo "==> The following packages are missing:"
echo "${missing[@]}"
echo ""
echo "==> Please install them with:"
echo "> ${install_command[$pm]}" "${missing[@]}"
exit 1
else
clear
welcome
install-theme
fi
}
if command -v apt-get &>/dev/null; then
check_dependencies "apt-get"
elif command -v dnf &>/dev/null; then
check_dependencies "dnf"
elif command -v emerge &>/dev/null; then
check_dependencies "emerge"
elif command -v nix-shell &>/dev/null; then
check_dependencies "nix-shell"
elif command -v pacman &>/dev/null; then
check_dependencies "pacman"
elif command -v cave &>/dev/null; then
check_dependencies "cave"
elif command -v apk &>/dev/null; then
check_dependencies "apk"
elif command -v xbps-install &>/dev/null; then
check_dependencies "xbps-install"
elif command -v eopkg &>/dev/null; then
check_dependencies "eopkg"
elif command -v brew &>/dev/null; then
check_dependencies "brew"
else
echo "==> Couldn't determine your package manager, install hints unavailable."
echo "==> Please install the following packages, before running the script again:"
echo ">" "${dependencies[@]}"
exit 1
fi