-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_2.sh
executable file
·133 lines (99 loc) · 3.15 KB
/
run_2.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
#!/usr/bin/env bash
# Script Directory
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
# Source Logo
source "${SCRIPT_DIR}/logo.sh"
# Greet
clear
logo
echo "Welcome to the post-install script !"
echo "Type p to proceed or e to exit"
read keyPressed
if [[ "${keyPressed}" = "p" ]]; then
echo ""
echo "-------------------------------------------------------------"
echo "--------------Installing Dependency ....---------------------"
echo "------------------------------------------------------------ "
echo ""
echo ""
sudo pacman -U --noconfirm "${SCRIPT_DIR}/storage/gum-0.11.0-1-x86_64.pkg.tar.zst"
clear
echo ""
echo "-------------------------------------------------------------"
echo "--------------DE/WM INSTALLATION...--------------------------"
echo "-------------------------------------------------------------"
echo ""
echo -e "Want a minimal setup :"
isMinimal=$(gum choose "No" "Yes")
clear
echo -e "Choose DE/WM to Install :"
choice=$(gum choose "DWM" "KDE" "Server")
## MAKE SCRIPTS EXECUTABLE
cd
if [[ "$isMinimal" == "Yes" ]]; then
chmod +x ~/setup/create_minimal.sh
~/setup/create_minimal.sh
fi
chmod +x ~/setup/3_0_packages.sh
~/setup/3_0_packages.sh
chmod +x ~/setup/3_1_browser.sh
~/setup/3_1_browser.sh
chmod +x ~/setup/4_cdx.sh
~/setup/4_cdx.sh "$choice" "$isMinimal"
if [[ $choice == "KDE" ]]; then
clear
chmod +x ~/setup/5_kde.sh
~/setup/5_kde.sh
elif [[ $choice == "DWM" ]]; then
clear
chmod +x ~/setup/5_dwm.sh
~/setup/5_dwm.sh
fi
## REFETCHING SETUP
echo ""
echo "-----------------------------------------------------------"
echo "--------------Refetching Setup ...-------------------------"
echo "-----------------------------------------------------------"
echo ""
cd
if [ -f "$HOME/setup/err.txt" ]; then
cp -r "$HOME/setup/err.txt" "$HOME/Downloads/"
fi
rm -rf setup
git clone https://github.com/glowfi/setup
## Run the performance&security script
chmod +x ~/setup/3_2_performance_security.sh
~/setup/3_2_performance_security.sh
## Regenerate GRUB and initramfs
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo mkinitcpio -p linux-zen
## CLEANUP
echo ""
echo "-----------------------------------------------------"
echo "--------------Cleaning up...-------------------------"
echo "-----------------------------------------------------"
echo ""
yes | sudo pacman -Sc
yes | yay -Sc
printf "Cleaned Unused Pacakges!\n"
sudo rm -rf ~/.cache/*
printf "Cleaned Cache!\n"
sudo pacman -Rns "$(pacman -Qtdq)"
yes | printf "Cleaned Orphans!"
## DELETE CACHED PASSWORD
sudo sed -i '72d' /etc/sudoers
## END
clear
logo
echo ""
echo ""
echo ""
echo " ▄▄▄ ▄ ▄▄▄ █ ▄ █ "
echo " ▀▄ ███ ▀█▀ █ █ █▀█ █ █▀█ ███ █▀█ █ ███ ▀█▀ ███ █ "
echo " ▄▄█ █▄▄ █▄ █▄█ █▄█ █▄▄ █▄█ █ █ █▄█ █▄ █▄▄ █▄ █▄▄ ▄ "
echo " █ █ "
echo -e "\nReboot Your PC now!"
else
echo "Exited !"
exit 1
fi