-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhyprland-setup.sh
220 lines (168 loc) · 7.49 KB
/
hyprland-setup.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
#!/usr/bin/env bash
# Version: v0.2
set -e
# Check if a command is available
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check if a package is installed
package_installed() {
pacman -Q "$1" >/dev/null 2>&1
}
setup_blackarch_repo() {
wget https://blackarch.org/strap.sh -O /tmp/strap.sh
chmod +x /tmp/strap.sh && cd /tmp/ && sudo ./strap.sh
}
setup_oh_my_zsh() {
# Change shell to zsh
sudo chsh -s /usr/bin/zsh $USER
# Install oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
# Install custom theme
wget https://raw.githubusercontent.com/FlareXes/dotfiles/main/.oh-my-zsh/custom/themes/archcraft.zsh-theme -O $HOME/.oh-my-zsh/custom/themes/archcraft.zsh-theme
# Overwrite the .zshrc
wget https://raw.githubusercontent.com/FlareXes/dotfiles/main/.zshrc -O $HOME/.zshrc && source $HOME/.zshrc
# Install Plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
}
enable_systemd_services() {
# Snap
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
# Docker
sudo systemctl enable --now docker.service
sudo systemctl start docker.service
sudo systemctl restart docker
sudo usermod -aG docker $USER
sudo docker run hello-world
# Ufw
sudo systemctl enable --now ufw
sudo systemctl start ufw
sudo ufw default allow outgoing
sudo ufw default deny incoming
sudo ufw enable
}
install_basic_packages() {
dependencies=("base-devel" "git" "gdb" "wget" "zsh" "curl" "go" "sed" "plocate" "net-tools" "ttf-jetbrains-mono-nerd" "flatpak" "reflector" "fastfetch" "neovim" "lsd" "mpv" "baobab" "expect" "axel" "pass-otp" "yt-dlp" "jq" "bc" "bat" "fzf" "unzip" "p7zip" "docker" "aws-cli" "ufw" "wireshark-qt" "timeshift" "python-pip" "bpython" "wtype" "macchanger" "firejail" "translate-shell" "obs-studio" "brightnessctl" "imagemagick" "swaylock" "grim" "slurp" "swappy" "rofi-wayland" "wl-clipboard")
# Install missing dependencies
for dependency in "${dependencies[@]}"; do
if ! command_exists "$dependency"; then
if ! package_installed "$dependency"; then
sudo pacman -S --disable-download-timeout --noconfirm "$dependency"
fi
fi
done
}
install_yay_packages() {
yay_dependencies=("librewolf-bin" "brave-bin" "appimagelauncher" "portmaster-stub-bin" "pup" "mpv-thumbnail-script" "hyprpicker-git" )
for dependency in "${yay_dependencies[@]}"; do
if ! command_exists "$dependency"; then
if ! package_installed "$dependency"; then
yay -S --noconfirm "$dependency"
fi
fi
done
}
install_snap_packages() {
if ! command_exists "code-insiders"; then
sudo snap install code-insiders --classic
fi
}
install_flatpak_packages() {
flatpak_dependencies=("md.obsidian.Obsidian" "io.freetubeapp.FreeTube" "com.github.tchx84.Flatseal" "org.gnome.World.PikaBackup")
for dependency in "${yay_dependencies[@]}"; do
if ! command_exists "$dependency"; then
flatpak install flathub "$dependency"
fi
done
}
install_from_aur() {
if ! command_exists "yay"; then
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay && makepkg -sirc --noconfirm
fi
if ! command_exists "snap"; then
git clone https://aur.archlinux.org/snapd.git /tmp/snapd
cd /tmp/snapd && makepkg -sirc --noconfirm
fi
}
install_github_tools() {
# Scripts
scripts=(
"fshare=https://raw.githubusercontent.com/FlareXes/fshare/main/fshare"
"myman=https://raw.githubusercontent.com/FlareXes/Micro-Utils/main/bin/myman"
"passrofi=https://raw.githubusercontent.com/FlareXes/passrofi/main/passrofi"
"check-breach=https://raw.githubusercontent.com/FlareXes/check-breach/main/check-breach"
)
# Tools
tools=(
"offsync=https://github.com/FlareXes/offsync.git"
"watodo=https://github.com/FlareXes/watodo.git"
)
# Install scripts from GitHub
for script in "${scripts[@]}"; do
name="${script%=*}"
url="${script#*=}"
if ! command_exists "$name"; then
sudo wget "$url" -O "/usr/local/bin/$name"
sudo chmod +x "/usr/local/bin/$name"
fi
done
# Install tools from GitHub
for tool in "${tools[@]}"; do
name="${tool%=*}"
url="${tool#*=}"
temp_dir=$(mktemp -d -t $name.XXXXXXXXXX)
if ! command_exists "$name"; then
git clone "$url" "$temp_dir"
cd "$temp_dir" && chmod +x setup.sh && ./setup.sh
fi
done
}
install_hacking_tools() {
dependencies=("hashcat" "johnny" "haiti" "feroxbuster" "nmap" "whois")
for dependency in "${dependencies[@]}"; do
if ! command_exists "$dependency"; then
if ! package_installed "$dependency"; then
sudo pacman -S --disable-download-timeout --noconfirm "$dependency"
fi
fi
done
}
update_configs() {
# Neovim
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1
sed -i "s/transparency = false/transparency = true/" ~/.config/nvim/lua/core/default_config.lua
}
miscellaneous() {
sudo wget https://raw.githubusercontent.com/FlareXes/Micro-Utils/main/systemd-unit/macspoof@.service -O /etc/systemd/system/macspoof@.service
sudo systemctl enable macspoof@wlan0.service
sudo wget https://raw.githubusercontent.com/FlareXes/Micro-Utils/main/systemd-unit/change-machine-id.service -O /etc/systemd/system/change-machine-id.service
sudo systemctl enable change-machine-id.service
git clone https://github.com/FlareXes/dotfiles.git $HOME/dotfiles
sudo chmod +x /usr/sbin/dumpcap /usr/bin/dumpcap
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# ██╗ ██╗ ██████╗ ██╗██████╗ ███╗ ███╗ █████╗ ██╗███╗ ██╗ #
# ██║ ██║██╔═══██╗██║██╔══██╗ ████╗ ████║██╔══██╗██║████╗ ██║ #
# ██║ ██║██║ ██║██║██║ ██║ ██╔████╔██║███████║██║██╔██╗ ██║ #
# ╚██╗ ██╔╝██║ ██║██║██║ ██║ ██║╚██╔╝██║██╔══██║██║██║╚██╗██║ #
# ╚████╔╝ ╚██████╔╝██║██████╔╝ ██║ ╚═╝ ██║██║ ██║██║██║ ╚████║ #
# ╚═══╝ ╚═════╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
sudo pacman -Syyu --noconfirm --disable-download-timeout
install_basic_packages
install_flatpak_packages
install_github_tools
install_from_aur
setup_oh_my_zsh
setup_blackarch_repo
install_hacking_tools
install_yay_packages
install_snap_packages
enable_systemd_services
update_configs
miscellaneous
echo -e "\nSCRIPT IS COMPLETED, REBOOT YOUR SYSTEM"