-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·268 lines (219 loc) · 7.19 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#!/bin/bash
#print-banner
figlet -f smblock -c "iemafzalhassan"
figlet -f smbraille -c "Custom Grub Boot loader Themes"
#/**
# *
# *
# * @license MIT
#
# * @author "iemafzalhassan" <[email protected]>
#
# * @version 1.0.0
#
# * @link https://github.com/iemafzalhassan
#
# *
# *
# * Grub bootloader Themes
# *
# */
#THEME_DIR='/usr/share/grub/themes'
THEME_DIR='/boot/grub/themes'
THEME_NAME=''
function echo_title() { echo -ne "\033[1;44;37m${*}\033[0m\n"; }
function echo_caption() { echo -ne "\033[0;1;44m${*}\033[0m\n"; }
function echo_bold() { echo -ne "\033[0;1;34m${*}\033[0m\n"; }
function echo_danger() { echo -ne "\033[0;31m${*}\033[0m\n"; }
function echo_success() { echo -ne "\033[0;32m${*}\033[0m\n"; }
function echo_warning() { echo -ne "\033[0;33m${*}\033[0m\n"; }
function echo_secondary() { echo -ne "\033[0;34m${*}\033[0m\n"; }
function echo_info() { echo -ne "\033[0;35m${*}\033[0m\n"; }
function echo_primary() { echo -ne "\033[0;36m${*}\033[0m\n"; }
function echo_error() { echo -ne "\033[0;1;31merror:\033[0;31m\t${*}\033[0m\n"; }
function echo_label() { echo -ne "\033[0;1;32m${*}:\033[0m\t"; }
function echo_prompt() { echo -ne "\033[0;36m${*}\033[0m "; }
function splash() {
local hr
hr=" **$(printf "%${#1}s" | tr ' ' '*')** "
echo_title "${hr}"
echo_title " * $1 * "
echo_title "${hr}"
echo
}
function check_root() {
# Checking for root access and proceed if it is present
ROOT_UID=0
if [[ ! "${UID}" -eq "${ROOT_UID}" ]]; then
# Error message
echo_error 'Run me as root.'
echo_info 'try sudo ./install.sh'
exit 1
fi
}
function select_theme() {
themes=('CyberEXS' 'Cyberpunk' 'CyberRe' 'CyberSynchro' 'fallout' 'grub_linea' 'mr-robot' 'shodan' 'vimix' 'virtual_future' 'Quit')
PS3=$(echo_prompt '\nChoose The Theme You Want: ')
select THEME_NAME in "${themes[@]}"; do
case "${THEME_NAME}" in
'CyberEXS')
splash 'Installing CyberEXS Theme...'
break;;
'Cyberpunk')
splash 'Installing Cyberpunk Theme...'
break;;
'CyberRe')
splash 'Installing CyberRe Theme...'
break;;
'CyberSynchro')
splash 'Installing CyberSynchro Theme...'
break;;
'fallout')
splash 'Installing fallout Theme...'
break;;
'grub_linea')
splash 'Installing grub_linea Theme...'
break;;
'mr-robot')
splash 'Installing mr-robot Theme...'
break;;
'shodan')
splash 'Installing shodan Theme...'
break;;
'vimix')
splash 'Installing vimix Theme...'
break;;
'virtual_future')
splash 'Installing virtual_future Theme...'
break;;
'Quit')
echo_info 'User requested exit...!'
exit 0;;
*) echo_warning "invalid option \"${REPLY}\"";;
esac
done
}
function backup() {
# Backup grub config
echo_info 'cp -an /etc/default/grub /etc/default/grub.bak'
cp -an /etc/default/grub /etc/default/grub.bak
}
function install_theme() {
# create themes directory if not exists
if [[ ! -d "${THEME_DIR}/${THEME_NAME}" ]]; then
# Copy theme
echo_primary "Installing ${THEME_NAME} theme..."
echo_info "mkdir -p \"${THEME_DIR}/${THEME_NAME}\""
mkdir -p "${THEME_DIR}/${THEME_NAME}"
echo_info "cp -a ./themes/\"${THEME_NAME}\"/* \"${THEME_DIR}/${THEME_NAME}\""
cp -a ./themes/"${THEME_NAME}"/* "${THEME_DIR}/${THEME_NAME}"
fi
}
function config_grub() {
echo_primary 'Enabling grub menu'
# remove default grub style if any
echo_info "sed -i '/GRUB_TIMEOUT_STYLE=/d' /etc/default/grub"
sed -i '/GRUB_TIMEOUT_STYLE=/d' /etc/default/grub
echo_info "echo 'GRUB_TIMEOUT_STYLE=\"menu\"' >> /etc/default/grub"
echo 'GRUB_TIMEOUT_STYLE="menu"' >> /etc/default/grub
#--------------------------------------------------
echo_primary 'Setting grub timeout to 60 seconds'
# remove default timeout if any
echo_info "sed -i '/GRUB_TIMEOUT=/d' /etc/default/grub"
sed -i '/GRUB_TIMEOUT=/d' /etc/default/grub
echo_info "echo 'GRUB_TIMEOUT=\"60\"' >> /etc/default/grub"
echo 'GRUB_TIMEOUT="60"' >> /etc/default/grub
#--------------------------------------------------
echo_primary "Setting ${THEME_NAME} as default"
# remove theme if any
echo_info "sed -i '/GRUB_THEME=/d' /etc/default/grub"
sed -i '/GRUB_THEME=/d' /etc/default/grub
echo_info "echo \"GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"\" >> /etc/default/grub"
echo "GRUB_THEME=\"${THEME_DIR}/${THEME_NAME}/theme.txt\"" >> /etc/default/grub
#--------------------------------------------------
echo_primary 'Setting grub graphics mode to auto'
# remove default timeout if any
echo_info "sed -i '/GRUB_GFXMODE=/d' /etc/default/grub"
sed -i '/GRUB_GFXMODE=/d' /etc/default/grub
echo_info "echo 'GRUB_GFXMODE=\"auto\"' >> /etc/default/grub"
echo 'GRUB_GFXMODE="auto"' >> /etc/default/grub
}
function update_grub() {
# Update grub config
echo_primary 'Updating grub config...'
if [[ -x "$(command -v update-grub)" ]]; then
echo_info 'update-grub'
update-grub
elif [[ -x "$(command -v grub-mkconfig)" ]]; then
echo_info 'grub-mkconfig -o /boot/grub/grub.cfg'
grub-mkconfig -o /boot/grub/grub.cfg
elif [[ -x "$(command -v grub2-mkconfig)" ]]; then
if [[ -x "$(command -v zypper)" ]]; then
echo_info 'grub2-mkconfig -o /boot/grub2/grub.cfg'
grub2-mkconfig -o /boot/grub2/grub.cfg
elif [[ -x "$(command -v dnf)" ]]; then
echo_info 'grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg'
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
fi
fi
}
function main() {
splash 'The Matrix awaits you...'
check_root
select_theme
install_theme
config_grub
update_grub
echo_success 'Boot Theme Update Successful!'
}
main
sleep 10s
### installation process begins here for grub-customizer (debian-based)
echo Author: iemafzalhassan
sleep 5s
echo hey...Folks.! ready to customise your bootloader..!
sleep 2s
echo 3s
sleep 2s
echo 2s
sleep 1s
echo 1s
sleep 1s
echo Booooom.....!!!!
sleep 2s
echo $(date)
sleep 2s
echo $(date)
sleep 2s
echo wait...installation begins...here.!
sleep 2s
##update checking...
echo checking for update
sleep 2s
sudo apt update
sleep 2s
echo updating
sleep 2s
sudo apt upgrade
sleep 2s
echo cloning repo for installing grub customiser
sleep 2s
echo cloning repo from
sleep 2s
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sleep 2s
##ckecking repo for update
echo updating please wait..!
sleep 2s
sudo apt update
sudo apt upgrade -y
sleep 2s
sudo apt install grub-customizer -y
sleep 2s
echo grub-customiser installed
sleep 2s
echo checking lates build
sudo apt update
sudo apt upgrade -y
echo updated...
echo now you can customize the other efi-partion which pop-up while booting --BOOTLOADER