-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathEASY-PWM.sh
659 lines (560 loc) · 28.6 KB
/
EASY-PWM.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
#!/bin/bash
#Colors
green="\e[0;32m\033[1m"
end="\033[0m\e[0m"
red="\e[0;31m\033[1m"
blue="\e[0;34m\033[1m"
yellow="\e[0;33m\033[1m"
purple="\e[0;35m\033[1m"
turquoise="\e[0;36m\033[1m"
gray="\e[0;37m\033[1m"
export DEBIAN_FRONTEND=noninteractive
function helpPanel(){
echo -e "\n${red}[!] Uso: $0 -v [1/0]"
for i in $(seq 1 80); do echo -ne ${red}═${end}; done
echo -e "\n\n\t${blue}\u2503${end} ${purple}[-v]${end} ${yellow}Agregar verbose${end}"
echo -e "\n\t\t${purple}(${end}${green}1${end}${purple})${end} ${turquoise}si${end} ${blue}[${yellow}Util para ver lo que está pasando${blue}]${end}"
echo -e "\t\t${purple}(${end}${green}0${end}${purple})${end} ${turquoise}no${end} ${blue}[${yellow}Output más bonito y organizado${blue}]${end}"
echo -e "\n\t${blue}\u2503${end} ${purple}[-h]${end}${yellow} Mostrar este panel de ayuda${end}\n"
}
function banner(){
tuput civis; clear
echo -e "\n${green}███████${turquoise}╗${gray}░${green}█████${turquoise}${turquoise}╗${gray}░░${green}██████${turquoise}${turquoise}╗${green}██${turquoise}╗${gray}░░░${green}██${turquoise}╗${gray}░░░░░░${green}██████${turquoise}╗${gray}░░${green}██${turquoise}╗${gray}░░░░░░░${green}██${turquoise}╗${green}███${turquoise}╗${gray}░░░${green}███${turquoise}╗"
sleep 0.05
echo -e "${green}██${turquoise}╔════╝${green}██${turquoise}╔══${green}██${turquoise}╗${green}██${turquoise}╔════╝╚${green}██${turquoise}╗${gray}░${green}██${turquoise}╔╝${gray}░░░░░░${green}██${turquoise}╔══${green}██${turquoise}╗${gray}░${green}██${turquoise}║${gray}░░${green}██${turquoise}╗${gray}░░${green}██${turquoise}║${green}████${turquoise}${turquoise}╗${gray}░${green}████${turquoise}║\t\t ${gray}BY ${purple}Invertebrado"
sleep 0.05
echo -e "${green}█████${turquoise}╗${gray}░░${green}███████${turquoise}║╚${green}█████${turquoise}╗${gray}░░${green}${turquoise}╚${green}████${turquoise}╔╝${gray}░${green}█████${turquoise}╗${green}██████${turquoise}╔╝${gray}░${turquoise}╚${green}██${turquoise}╗${green}████${turquoise}╗${green}██${turquoise}╔╝${green}██${turquoise}╔${green}████${turquoise}╔${green}██${turquoise}║\t${gray}PERSONAL PAGE ${yellow}https://invertebr4do.github.io"
sleep 0.05
echo -e "${green}██${turquoise}╔══╝${gray}░░${green}██${turquoise}╔══${green}██${turquoise}║${gray}░${turquoise}╚═══${green}██${turquoise}╗${gray}░░${turquoise}╚${green}██${turquoise}╔╝${gray}░░${turquoise}╚════╝${green}██${turquoise}╔═══╝${gray}░░░${green}████${turquoise}╔═${green}████${turquoise}║${gray}░${green}██${turquoise}║╚${green}██${turquoise}╔╝${green}██${turquoise}║\t ${gray}GITHUB ${turquoise}https://github.com/invertebr4do"
sleep 0.05
echo -e "${green}███████${turquoise}╗${green}██${turquoise}║${gray}░░${green}██${turquoise}║${green}██████${turquoise}╔╝${gray}░░░${green}██${turquoise}║${gray}░░░░░░░░░${green}██${turquoise}║${gray}░░░░░░░${turquoise}╚${green}██${turquoise}╔╝${gray}░${turquoise}╚${green}██${turquoise}╔╝${gray}░${green}██${turquoise}║${gray}░${turquoise}╚═╝${gray}░${green}██${turquoise}║\t ${gray}INSPIRED IN ${red}s4vitar ${gray}BSPWM CONFIGURATIONS"
sleep 0.05
echo -e "${turquoise}╚══════╝╚═╝${gray}░░${turquoise}╚═╝╚═════╝${gray}░░░░${turquoise}╚═╝${gray}░░░░░░░░░${turquoise}╚═╝${gray}░░░░░░░░${turquoise}╚═╝${gray}░░░${turquoise}╚═╝${gray}░░${turquoise}╚═╝${gray}░░░░░${turquoise}╚═╝${end}"
sleep 0.05
for i in $(seq 1 80); do echo -ne "${purple}-${end}"; done
}
function banner2(){
tuput civis; clear
echo -e "\n\t\t${green}███████${turquoise}╗${gray}░${green}█████${turquoise}${turquoise}╗${gray}░░${green}██████${turquoise}${turquoise}╗${green}██${turquoise}╗${gray}░░░${green}██${turquoise}╗${gray}░░░░░░${green}██████${turquoise}╗${gray}░░${green}██${turquoise}╗${gray}░░░░░░░${green}██${turquoise}╗${green}███${turquoise}╗${gray}░░░${green}███${turquoise}╗"
sleep 0.05
echo -e "\t\t${green}██${turquoise}╔════╝${green}██${turquoise}╔══${green}██${turquoise}╗${green}██${turquoise}╔════╝╚${green}██${turquoise}╗${gray}░${green}██${turquoise}╔╝${gray}░░░░░░${green}██${turquoise}╔══${green}██${turquoise}╗${gray}░${green}██${turquoise}║${gray}░░${green}██${turquoise}╗${gray}░░${green}██${turquoise}║${green}████${turquoise}${turquoise}╗${gray}░${green}████${turquoise}║"
sleep 0.05
echo -e "\t\t${green}█████${turquoise}╗${gray}░░${green}███████${turquoise}║╚${green}█████${turquoise}╗${gray}░░${green}${turquoise}╚${green}████${turquoise}╔╝${gray}░${green}█████${turquoise}╗${green}██████${turquoise}╔╝${gray}░${turquoise}╚${green}██${turquoise}╗${green}████${turquoise}╗${green}██${turquoise}╔╝${green}██${turquoise}╔${green}████${turquoise}╔${green}██${turquoise}║"
sleep 0.05
echo -e "\t\t${green}██${turquoise}╔══╝${gray}░░${green}██${turquoise}╔══${green}██${turquoise}║${gray}░${turquoise}╚═══${green}██${turquoise}╗${gray}░░${turquoise}╚${green}██${turquoise}╔╝${gray}░░${turquoise}╚════╝${green}██${turquoise}╔═══╝${gray}░░░${green}████${turquoise}╔═${green}████${turquoise}║${gray}░${green}██${turquoise}║╚${green}██${turquoise}╔╝${green}██${turquoise}║"
sleep 0.05
echo -e "\t\t${green}███████${turquoise}╗${green}██${turquoise}║${gray}░░${green}██${turquoise}║${green}██████${turquoise}╔╝${gray}░░░${green}██${turquoise}║${gray}░░░░░░░░░${green}██${turquoise}║${gray}░░░░░░░${turquoise}╚${green}██${turquoise}╔╝${gray}░${turquoise}╚${green}██${turquoise}╔╝${gray}░${green}██${turquoise}║${gray}░${turquoise}╚═╝${gray}░${green}██${turquoise}║"
sleep 0.05
echo -e "\t\t${turquoise}╚══════╝╚═╝${gray}░░${turquoise}╚═╝╚═════╝${gray}░░░░${turquoise}╚═╝${gray}░░░░░░░░░${turquoise}╚═╝${gray}░░░░░░░░${turquoise}╚═╝${gray}░░░${turquoise}╚═╝${gray}░░${turquoise}╚═╝${gray}░░░░░${turquoise}╚═╝${end}"
sleep 0.05
echo -e "\n\t\t\t\t\t ${gray}BY ${purple}Invertebrado"
sleep 0.05
echo -e "\t\t\t\t${gray}PERSONAL PAGE ${yellow}https://invertebr4do.github.io"
sleep 0.05
echo -e "\t\t\t\t ${gray}GITHUB ${turquoise}https://github.com/invertebr4do"
sleep 0.05
echo -e "\t\t\t\t ${gray}INSPIRED IN ${red}s4vitar ${gray}BSPWM CONFIGURATIONS"
sleep 0.05
echo -e "\t\t\t${red}s4vitar's ${gray}YOUTUBE CHANNEL ${red}https://www.youtube.com/s4vitar"
sleep 0.05
echo -e "\t\t\t ${red}s4vitar's ${gray}TWITCH CHANNEL ${purple}https://www.twitch.tv/S4vitaar${end}"
}
function ctrl_c(){
echo -e "\n\n${red}[!] Exiting...${end}\n"
tput cnorm; exit 1
}
trap ctrl_c INT
function status_code(){
if [ "$(echo $?)" != "0" ]; then
echo -e "\n${red}[X] OCURRIÓ UN PROBLEMA${end}\n"
tput cnorm; exit 1
fi
}
function check_user(){
if [ "$(id -u)" == "0" ]; then
echo -e "\n${red}[!] NO EJECUTAR ESTE SCRIPT COMO ROOT${end}\n"
tput cnorm; exit 1
fi
}
function check_internet(){
tput civis; ping -c 1 google.com > /dev/null 2>&1
if [[ "$(echo $?)" -eq 0 ]]; then
echo -e "\n${green}[✔] CON CONECCIÓN A INTERNET${end}"
sleep 1.5
else
echo -e "\n${red}[X] COMPRUEBA TU CONECCIÓN A INTERNET${end}"
tput cnorm; exit 1
fi
}
function iface(){
echo -e "\n${purple}█ ${gray}INGRESE EL NOMBRE DE SU INTERFAZ DE RED ${purple}█${end}\n"
for i in $(ip a | grep -oP ": .*?:" | tr -d ':'); do echo -e "\t${blue}· ${yellow}$i${end}"; done
echo -ne "\n${green}» ${gray}"; read -r ni; echo -e "${end}"
while [ ! $ni ]; do
echo -e "${red}[X] VALOR REQUERIDO${end}\n"
echo -ne "${green}» ${gray}"; read -r ni; echo -e "${end}"
done
sed -i "s/eth0/$ni/" Files/bin/ethernet_status.sh
}
function package_installer(){
if [ $(echo $verbose) == "1" ]; then
for package in ${required_packages[@]}; do
echo -ne "\t${yellow}[${blue}*${yellow}] INSTALANDO ${turquoise}$package${end}\n\n"
sudo apt install $package -y
status_code
for i in $(seq 1 7); do echo -ne "${yellow}.${end}"; sleep 0.1; done
echo -e " ${yellow}[${green}\u2713${yellow}]${end}"
sleep 1
done
elif [ $(echo $verbose) == "0" ]; then
for package in ${required_packages[@]}; do
echo -ne "\t${yellow}[${blue}*${yellow}] INSTALANDO ${turquoise}$package ${end}"
sudo apt install $package -y &>/dev/null
status_code
for i in $(seq 1 7); do echo -ne "${yellow}.${end}"; sleep 0.1; done
echo -e " ${yellow}[${green}\u2713${yellow}]${end}"
sleep 1
done
fi
}
function dependencies(){
banner; tput civis
echo -e "\n${yellow}[*] BUSCANDO ACTUALIZACIONES${end}"; sleep 1
update=$(sudo apt update | tail -n 1 | grep -oP "\d{1,5000}" | tr -d '\n')
if [ "$update" > "0" ]; then
echo -e "\n${purple}█ ${gray}HAY ${purple}$update${gray} PAQUETES POR ACTUALIZAR ${purple}█${end}"
fi
if [ "$(echo $?)" -eq 0 ]; then
if [ "$update" > "0" ]; then
echo -e "\n${yellow}[*] ACTUALIZANDO PAQUETES DEL SISTEMA${end}"; sleep 1
if [ $(echo $verbose) == "1" ]; then
sudo apt upgrade -y
elif [ $(echo $verbose) == "0" ]; then
sudo apt upgrade -y &>/dev/null
fi
if [ "$(echo $?)" != "0" ]; then
echo -e "\n${red}[X] OCURRIÓ UN PROBLEMA${end}\n"
exit 1
else
echo -e "\n${turquoise}█ ${gray}SISTEMA ACTUALIZADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
fi
else
echo -e "\n${turquoise}█ ${gray}NO SE ENCONTRARON PAQUETES POR ACTUALIZAR ${turquoise}█${end}"
fi
echo -ne \\n${yellow}[*] INSTALANDO ALGUNOS PAQUETES NECESARIOS = ;
sleep 2 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo -e "${end}\n"
declare -a required_packages=(build-essential libxcb-util0-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libxcb-xinerama0-dev libasound2-dev libxcb-xtest0-dev libxcb-shape0-dev libxinerama1 libxinerama-dev kitty flameshot brightnessctl pamixer moreutils)
package_installer
echo -e "\n${turquoise}█ ${gray}PAQUETES INSTALADOS CORRECTAMENTE ${turquoise}█${end}"
else
echo -e "\n${red}[X] OCURRIÓ UN PROBLEMA${end}\n"
tput cnorm; exit 1
fi
echo -e "\n${yellow}[*] CONFIGURANDO TERMINAL KITTY${end}"; sleep 1
mkdir ~/.config/kitty 2>/dev/null
cp {Files/kitty/kitty.conf,Files/kitty/color.ini} ~/.config/kitty/.
}
function bspwm_sxhkd(){
banner; tput civis
echo -e "\n${yellow}[*] CLONANDO BSPWM${end}"; sleep 1
if [ $(echo $verbose) == "1" ]; then
git clone https://github.com/baskerville/bspwm.git
elif [ $(echo $verbose) == "0" ]; then
git clone https://github.com/baskerville/bspwm.git &>/dev/null
fi
status_code
echo -e "\n${turquoise}█ ${gray}BSPWM CLONADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] CLONANDO SXHKD${end}"; sleep 1
if [ $(echo $verbose) == "1" ]; then
git clone https://github.com/baskerville/sxhkd.git
elif [ $(echo $verbose) == "0" ]; then
git clone https://github.com/baskerville/sxhkd.git &>/dev/null
fi
status_code
echo -e "\n${turquoise}█ ${gray}SXHKD CLONADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
function install_bspwm(){
cd bspwm/
make
status_code
sudo make install
status_code
cd ..
}
echo -e "\n${yellow}[*] INSTALANDO BSPWM (make)"; sleep 1
if [ $(echo $verbose) == "1" ]; then
install_bspwm
status_code
elif [ $(echo $verbose) == "0" ]; then
install_bspwm &>/dev/null
status_code
fi
echo -e "\n${turquoise}█ ${gray}BSPWM INSTALADO CORRECTAMENTE ${turquoise}█${end}"; sleep 1
echo -e "\n${yellow}[*] INSTALANDO SXHKD${end}"; sleep 1
function install_sxhkd(){
cd sxhkd/
make
status_code
sudo make install
status_code
cd ..
}
if [ $(echo $verbose) == "1" ]; then
install_sxhkd
status_code
elif [ $(echo $verbose) == "0" ]; then
install_sxhkd &>/dev/null
status_code
fi
echo -e "\n${turquoise}█ ${gray}SXHKD INSTALADO CORRECTAMENTE ${turquoise}█${end}"; sleep 1
echo -e "\n${yellow}[*] INSTALANDO BSPWM (apt)${end}"; sleep 1
if [ $(echo $verbose) == "1" ]; then
sudo apt install bspwm -y
elif [ $(echo $verbose) == "0" ]; then
sudo apt install bspwm -y &>/dev/null
fi
status_code
echo -e "\n${turquoise}█ ${gray}BSPWM INSTALADO CORRECTAMENTE ${turquoise}█${end}"; sleep 1
echo -e "\n${yellow}[*] CARGANDO ALGUNOS FICHEROS DE BSPWM Y SXHKD${end}"; sleep 1
mkdir ~/.config/{bspwm,sxhkd}
cp Files/bspwmrc ~/.config/bspwm/
status_code
echo -e "\n${turquoise}█ ${gray}FICHEROS CARGADOS CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] CONFIGURANDO BSPWMRC${end}"; sleep 1
cat Files/bspwmrc | sed 's/USER/'$USER'/g' > ~/.config/bspwm/bspwmrc && chmod +x ~/.config/bspwm/bspwmrc
status_code
echo -e "\n${turquoise}█ ${gray}BSPWMRC CONFIGURADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] CONFIGURANDO SXHKDRC${end}"; sleep 1
cat Files/sxhkdrc | sed 's/USER/'$USER'/g' > ~/.config/sxhkd/sxhkdrc
status_code
echo -e "\n${turquoise}█ ${gray}SXHKDRC CONFIGURADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] CONFIGURANDO BSPWM_RESIZE${end}"; sleep 1
mkdir ~/.config/bspwm/scripts/
cp Files/bspwm_resize ~/.config/bspwm/scripts/. && chmod +x ~/.config/bspwm/scripts/bspwm_resize
status_code
echo -e "\n${turquoise}█ ${gray}BSPWM_RESIZE CONFIGURADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1; tput cnorm
}
function Polybar(){
banner; tput civis
echo -ne \\n${yellow}[*] INSTALANDO PAQUETES NECESARIOS PARA LA POLYBAR = ;
sleep 2 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo -e "${end}\n"
declare -a required_packages=(cmake cmake-data pkg-config python3-sphinx libcairo2-dev libxcb1-dev libxcb-randr0-dev libxcb-composite0-dev python3-xcbgen xcb-proto libxcb-image0-dev libxcb-xkb-dev libxcb-xrm-dev libxcb-cursor-dev libasound2-dev libpulse-dev libjsoncpp-dev libmpdclient-dev libuv1-dev libnl-genl-3-dev)
package_installer
echo -e "\n${turquoise}█ ${gray}PAQUETES INSTALADOS CORRECTAMENTE ${turquoise}█${end}"
function install_polybar(){
git clone --recursive https://github.com/polybar/polybar
cd polybar/
mkdir build
cd build/
cmake ..
status_code
make -j$(nproc)
status_code
sudo make install
}
echo -e "\n${yellow}[*] CLONANDO E INSTALANDO POLYBAR"; sleep 1
if [ $(echo $verbose) == "1" ]; then
install_polybar
status_code
elif [ $(echo $verbose) == "0" ]; then
install_polybar &>/dev/null
status_code
fi
mkdir ~/.config/polybar
echo -e "\n${turquoise}█ ${gray}POLYBAR INSTALADA CORRECTAMENTE ${turquoise}█${end}"
sleep 1; tput cnorm
}
function picom_rofi(){
banner; tput civis
echo -e "\n${yellow}[*] ACTUALIZANDO EL SISTEMA${end}"; sleep 1
if [ $(echo $verbose) == "1" ]; then
sudo apt update
elif [ $(echo $verbose) == "0" ]; then
sudo apt update &>/dev/null
fi
status_code
echo -e "\n${turquoise}█ ${gray}SISTEMA ACTUALIZADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -ne \\n${yellow}[*] INSTALANDO PAQUETES NECESARIOS PARA PICOM = ;
sleep 2 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo -e "${end}\n"
declare -a required_packages=(meson libxext-dev libxcb-damage0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-render-util0-dev libxcb-render0-dev libxcb-present-dev libpixman-1-dev libconfig-dev libgl1-mesa-dev libpcre3 libpcre3-dev libevdev-dev uthash-dev libev-dev libx11-xcb-dev libxcb-glx0-dev libdbus-1-dev)
package_installer
echo -e "\n${turquoise}█ ${gray}PAQUETES INSTALADOS CORRECTAMENTE ${turquoise}█${end}"
sleep 1
function install_picom(){
git clone https://github.com/ibhagwan/picom.git
cd picom/
git submodule update --init --recursive
status_code
meson --buildtype=release . build
status_code
sudo ninja -C build
status_code
sudo ninja -C build install
}
echo -e "\n${yellow}[*] INSTALANDO PICOM"; sleep 1
if [ $(echo $verbose) == "1" ]; then
install_picom
status_code
elif [ $(echo $verbose) == "0" ]; then
install_picom &>/dev/null
status_code
fi
cd ..
echo -e "\n${turquoise}█ ${gray}PICOM INSTALADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] INSTALANDO ROFI"; sleep 1
if [ $(echo $verbose) == "1" ]; then
sudo apt install rofi -y
elif [ $(echo $verbose) == "0" ]; then
sudo apt install rofi -y &>/dev/null
fi
status_code
cd ../../..
rm -rf ~/.config/rofi
mkdir ~/.config/rofi
status_code
echo -e "\n${turquoise}█ ${gray}ROFI INSTALADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] CONFIGURANDO TEMA DE ROFI"; sleep 1
if [ $(echo $verbose) == "1" ]; then
git clone https://github.com/adi1090x/rofi.git
elif [ $(echo $verbose) == "0" ]; then
git clone https://github.com/adi1090x/rofi.git &>/dev/null
fi
mkdir ~/.config/rofi 2>/dev/null && rm -rf ~/.config/rofi/*
cp -R {rofi/files/colors,rofi/files/images,rofi/files/launchers,rofi/files/powermenu} ~/.config/rofi/.
echo -e "\n${turquoise}█ ${gray}TEMA DE ROFI CONFIGURADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
}
function feh_ilock(){
banner; tput civis
echo -e "\n${yellow}[*] INSTALANDO FEH"; sleep 1
if [ $(echo $verbose) == "1" ]; then
sudo apt install feh -y
elif [ $(echo $verbose) == "0" ]; then
sudo apt install feh -y &>/dev/null
fi
status_code
cp EASY-PWM/Files/Wallpaper.jpg ~/Pictures/.
echo -e "\n${turquoise}█ ${gray}FEH INSTALADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -ne \\n${yellow}[*] INSTALANDO DEPENDENCIAS PARA I3LOCK = ;
sleep 2 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo -e "${end}\n"
declare -a required_packages=(autoconf gcc make pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util0-dev libxcb-xrm-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev)
package_installer
echo -e "\n${turquoise}█ ${gray}DEPENDENCIAS INSTALADAS CORRECTAMENTE ${turquoise}█${end}"
sleep 1
}
function extra_utilities(){
banner; tput civis
echo -ne \\n${yellow}[*] INSTALANDO ALGUNAS UTILIDADES EXTRA = ;
sleep 2 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo -e "${end}\n"
declare -a required_packages=(xclip caja flameshot scrub brightnessctl)
package_installer
echo -e "\n${turquoise}█ ${gray}UTILIDADES INSTALADAS CORRECTAMENTE ${turquoise}█${end}"
sleep 1; tput cnorm
}
function fonts(){
banner; tput civis
echo -e "\n${yellow}[*] INSTALANDO HACK NERD FONTS"; sleep 1
cd Files
if [ $(echo $verbose) == "1" ]; then
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.2/Hack.zip
elif [ $(echo $verbose) == "0" ]; then
wget -q https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.2/Hack.zip
fi
unzip Hack.zip > /dev/null 2>&1 && sudo mv *.ttf /usr/local/share/fonts/.
rm Hack.zip LICENSE.md readme.md
echo -e "\n${turquoise}█ ${gray}HACK NERD FONTS INSTALADAS CORRECTAMENTE ${turquoise}█${end}"; sleep 1
status_code; tput cnorm
}
function configs(){
banner; tput civis
echo -e "\n${yellow}[*] AÑADIENDO Y CONFIGURANDO POLYBAR${end}"; sleep 1
cd EASY-PWM/Files
sed -i "s/USER/$USER/g" polybar/scripts/powermenu
sed -i "s/USER/$USER/g" polybar/scripts/powermenu_alt
cp polybar/* -r ~/.config/polybar/. && chmod +x ~/.config/polybar/launch.sh
sudo cp polybar/fonts/* /usr/share/fonts/truetype/. && fc-cache -v &>/dev/null
mkdir ~/.config/bin && sudo rm -r ../bspwm ../polybar ../sxhkd ../0
cp bin -r ~/.config/. && chmod +x ~/.config/bin/ethernet_status.sh ~/.config/bin/hackthebox_status.sh ~/.config/bin/target_ip.sh && chmod +x ~/.config/polybar/scripts/launcher ~/.config/polybar/scripts/powermenu ~/.config/polybar/scripts/powermenu_alt
status_code
echo -e "\n${turquoise}█ ${gray}POLYBAR AÑADIDA Y CONFIGURADA CORRECTAMENTE ${turquoise}█${end}"; sleep 1
echo -e "\n${yellow}[*] CONFIGURANDO PICOM"; sleep 1
mkdir ~/.config/picom
cp picom.conf ~/.config/picom/.
status_code
echo -e "\n${turquoise}█ ${gray}PICOM CONFIGURADO CORRECTAMENTE ${turquoise}█${end}"; sleep 1
echo -e "\n${yellow}[*] ACTUALIZANDO EL SISTEMA${end}"; sleep 1
if [ $(echo $verbose) == "1" ]; then
sudo apt update
elif [ $(echo $verbose) == "0" ]; then
sudo apt update &>/dev/null
fi
status_code
echo -e "\n${turquoise}█ ${gray}SISTEMA ACTUALIZADO CORRECTAMENTE ${turquoise}█${end}"; sleep 1
echo -ne \\n${yellow}[*] INSTALANDO I3LOCK Y PAQUETES NECESARIOS PARA I3LOCK-COLOR = ;
sleep 2 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
echo -e "${end}\n"
declare -a required_packages=(libpam0g-dev libxrandr-dev libfreetype6-dev libxft-dev i3lock autoconf gcc make pkg-config libpam0g-dev libcairo2-dev libfontconfig1-dev libxcb-composite0-dev libev-dev libx11-xcb-dev libxcb-xkb-dev libxcb-xinerama0-dev libxcb-randr0-dev libxcb-image0-dev libxcb-util0-dev libxcb-xrm-dev libxcb-xtest0-dev libxkbcommon-dev libxkbcommon-x11-dev libjpeg-dev)
package_installer
echo -e "\n${turquoise}█ ${gray}I3LOCK Y DEPENDENCIAS INSTALADAS CORRECTAMENTE ${turquoise}█${end}"
sleep 1
function install_ilock-col(){
git clone https://github.com/Raymo111/i3lock-color ~/i3lock-color
mv ~/i3lock-color . && cd i3lock-color
bash install-i3lock-color.sh
status_code
}
echo -e "\n${yellow}[*] CLONANDO E INSTALANDO I3LOCK-COLOR"; sleep 1
if [ $(echo $verbose) == "1" ]; then
install_ilock-col
elif [ $(echo $verbose) == "0" ]; then
install_ilock-col &>/dev/null
fi
echo -e "\n${turquoise}█ ${gray}I3LOCK INSTALADO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] CONFIGURANDO FICHEROS PARA I3LOCK-COLOR"; sleep 1
cd ..
chmod +x i3lock-color/examples/lock.sh && mv i3lock-color ~/
status_code
sudo rm -r ../bspwm ../polybar ../sxhkd ../0
echo -e "\n${turquoise}█ ${gray}FICHEROS DE I3LOCK-COLOR CONFIGURADOS CORRECTAMENTE ${turquoise}█${end}"
sleep 1; tput cnorm
}
function zsh_config(){
banner; tput civis
sudo ln -s -f /home/$USER/.zshrc /root/.zshrc
echo -e "\n${yellow}[*] CLONANDO Y AÑADIENDO POWELEVEL10K PARA EL USUARIO ${gray}$USER${end}"; sleep 1
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k > /dev/null 2>&1
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc
echo -e "\n${yellow}[*] CLONANDO Y AÑADIENDO POWELEVEL10K PARA EL USUARIO ${gray}root${end}"; sleep 1
sudo git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /root/powerlevel10k > /dev/null 2>&1
status_code
cd Files
echo -e "\n${turquoise}█ ${gray}POWELEVEL10K INSTALADO Y AÑADIDO CORRECTAMENTE PARA LOS DOS USUARIOS ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] AÑADIENDO BAT Y LSD A LA ZSH${end}"
if [ $(echo $verbose) == "1" ]; then
sudo apt install bat -y
sudo apt install lsd -y
elif [ $(echo $verbose) == "0" ]; then
sudo apt install bat -y &>/dev/null
sudo apt install lsd -y &>/dev/null
fi
status_code
echo -e "\n${turquoise}█ ${gray}BAT Y LSD INSTALADO Y AÑADIDO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] AÑADIENDO PLUGIN DE SUDO A LA ZSH${end}"
sudo mkdir /usr/share/zsh-plugins && sudo cp sudo.plugin.zsh /usr/share/zsh-plugins/.
sed -i "s/USER/$USER/g" zsh-adds && cat zsh-adds >> ~/.zshrc && sudo chown $USER:$USER /usr/share/zsh-plugins/ && sudo chown $USER:$USER /usr/share/zsh-plugins/sudo.plugin.zsh
status_code
echo -e "\n${turquoise}█ ${gray}PLUGIN DE SUDO AÑADIDO CORRECTAMENTE ${turquoise}█${end}"
sleep 1
echo -e "\n${yellow}[*] CLONANDO E INSTALANDO FZF PARA EL USUARIO ${gray}$USER${end}"
if [ $(echo $verbose) == "1" ]; then
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
elif [ $(echo $verbose) == "0" ]; then
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf &>/dev/null
~/.fzf/install --all &>/dev/null
fi
echo -e "\n${yellow}[*] CLONANDO E INSTALANDO FZF PARA EL USUARIO ${gray}root${end}"
if [ $(echo $verbose) == "1" ]; then
sudo git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
sudo ~/.fzf/install --all
elif [ $(echo $verbose) == "0" ]; then
sudo git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf &>/dev/null
sudo ~/.fzf/install --all &>/dev/null
fi
status_code
echo -e "\n${turquoise}█ ${gray}FZF INSTALADO CORRECTAMENTE PARA LOS DOS USUARIOS ${turquoise}█${end}"
echo -e "\n${yellow}[*] CLONANDO E INSTALANDO NVCHAD PARA EL USUARIO ${gray}$USER${end}"
rm -rf ~/.config/nvim
if [ $(echo $verbose) == "1" ]; then
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1
elif [ $(echo $verbose) == "0" ]; then
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 &>/dev/null
fi
status_code
pushd /opt &>/dev/null && sudo wget -q https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz && sudo tar -xf nvim-linux64.tar.gz; popd &>/dev/null
echo -e "\n${yellow}[*] CLONANDO E INSTALANDO NVCHAD PARA EL USUARIO ${gray}root${end}"
sudo rm -rf /root/.config/nvim
if [ $(echo $verbose) == "1" ]; then
sudo git clone https://github.com/NvChad/NvChad /root/.config/nvim --depth 1
elif [ $(echo $verbose) == "0" ]; then
sudo git clone https://github.com/NvChad/NvChad /root/.config/nvim --depth 1 &>/dev/null
fi
status_code
echo -e "\n${turquoise}█ ${gray}NVCHAD CLONADO E INSTALADO CORRECTAMENTE ${turquoise}█${end}"
sleep 5; tput cnorm
}
function change_session(){
echo -ne "\n\t\t${purple}█ ${gray}¿DESEA CERRAR ESTA SESIÓN PARA INICIAR LA NUEVA CONFIGURACIÓN? [Y/N]${purple} █> ${end}" && read a
if [[ "$a" == "Y" || "$a" == "y" ]]; then
tput civis
echo -e "\n${red}"
echo -n █ CERRANDO SESIÓN - INICIE SESIÓN EN BSPWM COMO EL USUARIO $USER = ;
sleep 20 & while [ "$(ps a | awk '{print $1}' | grep $!)" ] ; do for X in '-' '\' '|' '/'; do echo -en "\b$X"; sleep 0.1; done; done
kill -9 -1
fi
}
#══════════════┃ MAIN ┃═════════════
declare -i parameter_counter=0; while getopts ":v:h:" arg; do
case $arg in
v) verbose=$OPTARG; let parameter_counter+=1;;
h) helpPanel;;
esac
done
if [ $parameter_counter -eq 0 ]; then
helpPanel
else
if [ $(echo $verbose) == "0" ]; then
check_user 2>/dev/null
iface 2>/dev/null
check_internet 2>/dev/null
dependencies 2>/dev/null
bspwm_sxhkd 2>/dev/null
Polybar 2>/dev/null
picom_rofi 2>/dev/null
feh_ilock 2>/dev/null
extra_utilities 2>/dev/null
fonts 2>/dev/null
configs 2>/dev/null
zsh_config 2>/dev/null
banner2
change_session
tput cnorm
elif [ $(echo $verbose) == "1" ]; then
check_user
iface
check_internet
dependencies
bspwm_sxhkd
Polybar
picom_rofi
feh_ilock
extra_utilities
fonts
configs
zsh_config
banner2
change_session
tput cnorm
else
echo -e "${red}[!] OPCIÓN INVÁLIDA${end}"
exit 1
fi
fi