-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhack_env
More file actions
executable file
·133 lines (114 loc) · 3.6 KB
/
hack_env
File metadata and controls
executable file
·133 lines (114 loc) · 3.6 KB
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
#!/bin/bash
# Define colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
install() {
for pkg in "$@"; do
yay -Sy --noconfirm "$pkg"
if [ $? -ne 0 ]; then
echo -e "${RED}Failed to install $pkg. Check ~/installation.log for details.${NC}"
echo "$pkg" >> ~/installation.log
else
echo -e "${GREEN}Successfully installed $pkg.${NC}"
fi
done
}
setup_android_dir(){
sudo groupadd android-sdk
sudo gpasswd -a $USER android-sdk
sudo setfacl -R -m g:android-sdk:rwx /opt/android-sdk
sudo setfacl -R -m g:android-sdk:rwx /opt/android-sdk
newgrp android-sdk
}
write_pac(){
sudo tee /etc/pacman.conf << EOF
[options]
HoldPkg = pacman glibc
Architecture = auto
#IgnorePkg =
#IgnoreGroup =
HoldPkg = pacman glibc dracut kernel-install-for-dracut eos-dracut
Architecture = auto
Color
ILoveCandy
CheckSpace
VerbosePkgLists
ParallelDownloads = 5
DownloadUser = alpm
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
[endeavouros]
SigLevel = PackageRequired
Include = /etc/pacman.d/endeavouros-mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
[athena]
SigLevel = Optional TrustedOnly
Include = /etc/pacman.d/athena-mirrorlist
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist
EOF
}
setup_repo(){
# Initialize the keyring if it's not already initialized
sudo pacman-key --init
sudo pacman-key --populate archlinux
# Setup athena repo and key
if [ ! -f /etc/pacman.d/athena-mirrorlist ]; then
sudo curl https://raw.githubusercontent.com/Athena-OS/athena/main/packages/os-specific/system/athena-mirrorlist/athena-mirrorlist -o /etc/pacman.d/athena-mirrorlist
if ! sudo pacman-key --list-keys A3F78B994C2171D5 > /dev/null 2>&1; then
sudo pacman-key --recv-keys A3F78B994C2171D5 --keyserver keys.openpgp.org
sudo pacman-key --lsign A3F78B994C2171D5
fi
echo -e "${GREEN}Athena repo installed successfully.${NC}"
else
echo -e "${YELLOW}[!] Athena Repo Already Installed${NC}"
fi
# Setup chaotic repo and key
if [ ! -f /etc/pacman.d/chaotic-mirrorlist ]; then
sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
sudo pacman-key --lsign-key 3056513887B78AEB
sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
sudo pacman -U --noconfirm 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
echo -e "${GREEN}Chaotic repo installed successfully.${NC}"
else
echo -e "${YELLOW}[!] Chaotic Repo Already Installed${NC}"
fi
}
main(){
if [ ! -f /etc/pacman.conf.bak ]; then
echo -e "${YELLOW}Installing Repos...${NC}"
sudo cp /etc/pacman.conf /etc/pacman.conf.bak
setup_repo
write_pac
install "${apps[@]}"
echo -e "${GREEN}Your old pacman.conf backed up in /etc/pacman.conf.bak${NC}"
if [ "$XDG_CURRENT_DESKTOP" == "Hyprland" ]; then
hyprctl dispatch exec "[float] athena-welcome"
else
athena-welcome
fi
else
echo -e "${YELLOW}[!] Seems your Repos Already Installed${NC}"
fi
}
apps=(
athena-welcome
)
# main
if command -v yay > /dev/null 2>&1; then
command -v alacritty >/dev/null 2>&1 || sudo pacman -S --noconfirm alacritty
main
else
echo -e "${RED}[!] Pkg yay Not found${NC}"
sudo pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -sifr --noconfirm
cd ..; [[ -d yay ]] && rm -rf yay
echo -e "${GREEN}yay installed. Rerunning script...${NC}"
exec "$0" "$@"
fi