-
Notifications
You must be signed in to change notification settings - Fork 18
/
install.sh
executable file
·126 lines (108 loc) · 3.97 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
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
#!/bin/sh
echo "\e[38;5;91m"
echo """
XXXXXXXXXXXMXXXXX
XXXXXXXX XXXXXXXX
XXXXXXX XXXXX XXX XXAXXXK
XXXXXX X XXXXXXX XXX XXE XXXXXI
TXXX XXXXXX XYX OUXX XXX XXRXXXS X XXMX
XAX XXXX XXX KXE XXX XXX XXX IXX XX XXXXXX TXX
YX XXXOUXX RX XSXXXX MXX XAX XXKX XXX XEI TX
YXO XX XU XXXRXX XXX XXS MXXXXX XXX XXX XAX
XXX XK XX XX XX EXX XXX XIX XXXXXX XXX
XXX XXX XTX XXXXXYX OXUXXXX XXRXXXX XXXS XXM XA XXX
XXX XKXXX XEXXX XXXIT XXXXYXO XUXXXXR SXX XXX XXM
AXX KX
XXX XXX XXE XXI XXXXXX XXXXTXX YXXXOXX XXXXXX UXX
XXX XXRXXXXX SXXMX XXXXXXXA XXXXKXE XXX XXI XTY XXO
XXX XXXXXURX XXXXX XXS XX XXX XXX XXXXXXX XXX
XXX XXXXMXXX AX XX XXXXX XXX KXEXIXT XXXXXX YXX
XO XUXXX XX XXX XRX XSXXM XXX XXX XXA XKE XX
IXXX X XX XXXTXXX XXY XXX XXX OXX XUX RSXXX
MAXX XX KXX EXI XXXX XTX XXXXXXX YXOX
XXUXXX XXX XXXXXRXX XXX XSM XXXXXXX
XXXXXX XXAXXX XXX XXKXXE
XXXXITXX XYOXXXUX
XXXXXXXXXRXXXSXXX
"""
echo "\e[37;1m Cooler Master Pi Tool Installer\e[0m"
echo ""
sleep 0.5
echo " This tool is designed to be used together with Cooler Master's Pi Case 40,"
echo " for more information visit https://www.coolermaster.com"
echo ""
echo ""
sleep 1
apply_gtk_theme()
{
git clone https://github.com/Joshaby/Adapta-Colorpack
cd Adapta-Colorpack/Pkg/usr/share/themes/Adapta-Purple-Nokto-Eta/
find . -type f -name "*.css" -exec sed -i 's/rgba\(156, 39, 176, 0.8\)/rgba\(132, 50, 155, 0.9\)/g' {} +
find . -type f -name "*.css" -exec sed -i 's/#263238/#53565A/g' {} +
find . -type f -name "*.css" -exec sed -i 's/#9C27B0/#84329B/g' {} +
cd ..
mkdir -p /home/$USER/.themes
cp -r Adapta-Purple-Nokto-Eta /home/$USER/.themes/Adapta-CoolerMaster
GTK_CONFIG="/home/$USER/.gtkrc-2.0"
if [ -f "$GTK_CONFIG" ]; then
if [ ! -z $(grep "gtk-theme-name" "$GTK_CONFIG") ]; then
sed -i 's/^gtk-theme-name=.*/gtk-theme-name="Adapta-CoolerMaster"/g' "$GTK_CONFIG"
else
echo 'gtk-theme-name="Adapta-CoolerMaster"' >> "$GTK_CONFIG"
fi
else
echo 'gtk-theme-name="Adapta-CoolerMaster"' > "$GTK_CONFIG"
fi
while true; do
read -p " Do you want to apply these changes now? [Y/n]: " yn
case $yn in
[Yy]* ) lxpanelctl restart && openbox --restart; break;;
[Nn]* ) break;;
* ) echo " Please answer yes or no.";;
esac
done
echo " You can select the CM theme by executing 'lxappearance'."
}
customize_desktop()
{
echo ""
echo ""
echo "\e[34m === Desktop customization === \e[0m"
echo " Installing theme installation dependencies..."
sudo apt install git
echo " Changing wallpaper..."
cp /tmp/cm_wallpaper.jpg ~/.cm_wallpaper.jpg
pcmanfm --set-wallpaper ~/.cm_wallpaper.jpg
echo " Changing GTK theme..."
apply_gtk_theme
echo ""
echo "\e[32m Done!\e[0m"
}
# Download everything
echo " Downloading data..."
cd /tmp
curl -L https://github.com/CoolerMasterTechnology/Pi-Tool/releases/latest/download/pi-tool-$(dpkg --print-architecture).deb -o pi-tool.deb
curl -L https://github.com/CoolerMasterTechnology/Pi-Tool/raw/master/theme/cm_wallpaper.jpg -o cm_wallpaper.jpg
echo ""
echo " Download finished!"
while true; do
read -p " Do you want to install the Cooler Master desktop customizations? [Y/n]: " yn
case $yn in
[Yy]* ) customize_desktop; break;;
[Nn]* ) break;;
* ) echo " Please answer yes or no.";;
esac
done
echo ""
sleep 1
echo "\e[34m === Pi Tool installation ===\e[0m"
echo " Installing..."
deb_file_path="/tmp/pi-tool*.deb"
sudo apt-get install $deb_file_path
echo " "
echo "\e[32m Done!\e[0m"
echo ""
echo ""
sleep 1
echo " You can now start the Pi Tool from your start menu. Have fun!"
echo ""