forked from erikdubois/arcolinux-nemesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-me-started
executable file
·116 lines (103 loc) · 3.89 KB
/
get-me-started
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
#!/bin/bash
#set -e
##################################################################################################################
# Author : Erik Dubois
# Website : https://www.erikdubois.be
# Website : https://www.alci.online
# Website : https://www.arcolinux.info
# Website : https://www.arcolinux.com
# Website : https://www.arcolinuxd.com
# Website : https://www.arcolinuxb.com
# Website : https://www.arcolinuxiso.com
# Website : https://www.arcolinuxforum.com
##################################################################################################################
#
# DO NOT JUST RUN THIS. EXAMINE AND JUDGE. RUN AT YOUR OWN RISK.
#
##################################################################################################################
#tput setaf 0 = black
#tput setaf 1 = red
#tput setaf 2 = green
#tput setaf 3 = yellow
#tput setaf 4 = dark blue
#tput setaf 5 = purple
#tput setaf 6 = cyan
#tput setaf 7 = gray
#tput setaf 8 = light blue
##################################################################################################################
tput setaf 1;
echo "###############################################################################"
echo "### SCRIPT TO REMOVE ELEMENTS WITH NO QUESTIONS ASKED"
echo "###"
echo "### - KEEP LINUX KERNEL GET RID OF THE OTHER KERNELS"
echo "### - GET RID OF BROADCOM AND REALTEK DRIVERS"
echo "### - GET RID OF CONKYS"
echo "###############################################################################"
tput sgr0
#######broadcom and realtek
sudo pacman -Rs broadcom-wl-dkms rtl8821cu-morrownr-dkms-git --noconfirm
# Ensure at least one kernel remains
if pacman -Qi linux &> /dev/null && pacman -Qi linux-headers &> /dev/null; then
# Define all the kernels and their headers you want to remove
KERNELS_TO_REMOVE=(
linux-lts-headers linux-lts
linux-zen-headers linux-zen
linux-hardened-headers linux-hardened
linux-rt-headers linux-rt
linux-rt-lts-headers linux-rt-lts
linux-cachyos-headers linux-cachyos
linux-xanmod-headers linux-xanmod
)
remove_package() {
local package=$1
# Check if the package is installed
if pacman -Q $package &> /dev/null; then
echo "$package is installed. Removing..."
sudo pacman -Rns --noconfirm $package
else
echo "$package is not installed."
fi
}
# Loop over the array and remove each kernel package
for kernel in "${KERNELS_TO_REMOVE[@]}"; do
remove_package "$kernel"
done
else
echo "Cannot proceed: At least one kernel must remain installed."
fi
#######conkys
# Array of packages to check
packages=("conky-lua-archers" "arcolinux-conky-collection-git" "arcolinux-conky-collection-plasma-git")
# Function to check if a package is installed
is_package_installed() {
if pacman -Q "$1" &> /dev/null; then
echo "Package $1 is installed."
return 0 # Success
else
echo "Package $1 is not installed."
return 1 # Failure
fi
}
# Iterate over each package in the array
for package in "${packages[@]}"; do
if is_package_installed "$package"; then
echo "Removing $package..."
sudo pacman -Rns "$package" --noconfirm
else
echo "$package is not installed, no need to remove."
fi
echo
echo "########################"
echo "Double checking $package"
echo "########################"
echo
if ! is_package_installed "$package"; then
echo "$package is not installed!"
else
echo "$package is still installed. Check manually why not."
fi
done
echo
echo "###############################################################################"
echo "### DONE - YOU CAN CLOSE THIS WINDOW ####"
echo "###############################################################################"