-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
executable file
·115 lines (105 loc) · 4.67 KB
/
main.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
#!/bin/bash
# Importar módulos
source "scripts/package_manager.sh"
source "scripts/system_update.sh"
source "scripts/software_installation.sh"
source "scripts/webapp_config.sh"
source "scripts/dotfiles.sh"
source "scripts/system_config.sh"
source "scripts/helper.sh"
# Function to display help
show_help() {
echo
echo "Archemy: Linux Installation and Configuration System"
echo
echo "Description:"
echo " Archemy is a script for installing and configuring Linux systems,"
echo " focusing on Arch and derivative distributions. It automates the installation of"
echo " packages, WebApps configuration, Hyprland dotfiles installation, and"
echo " system optimizations."
echo
echo "Features:"
echo " - Automatic package manager detection"
echo " - Package installation via pacman, paru, yay, apt, dnf, and Flatpak"
echo " - WebApps configuration"
echo " - Hyprland dotfiles installation"
echo " - System optimizations"
echo
echo "Options:"
echo " ./main.sh -h, --help Display this help message"
echo " ./main.sh -i, --minimal Install all applications"
echo " ./main.sh -w, --webapps Install all WebApps"
echo " ./main.sh -c, --complete Install all applications, WebApps, and sync the clock"
echo " ./main.sh Run the script without options to display the interactive menu"
}
# Verificar argumentos de linha de comando
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
show_help
exit 0
elif [[ "$1" == "-i" || "$1" == "--minimal" ]]; then
install_all_apps
exit 0
elif [[ "$1" == "-w" || "$1" == "--webapps" ]]; then
install_all_webapps
exit 0
elif [[ "$1" == "-c" || "$1" == "--complete" ]]; then
install_all_apps
install_all_webapps
sync_windows_clock
exit 0
fi
package_manager=$(detect_package_manager)
# Menu principal
main_menu() {
while true; do
echo "▄▄▄ ██▀███ ▄████▄ ██░ ██ ▓█████ ███▄ ▄███▓▓██ ██▓"
echo "▒████▄ ▓██ ▒ ██▒▒██▀ ▀█ ▓██░ ██▒▓█ ▀ ▓██▒▀█▀ ██▒ ▒██ ██▒"
echo "▒██ ▀█▄ ▓██ ░▄█ ▒▒▓█ ▄ ▒██▀▀██░▒███ ▓██ ▓██░ ▒██ ██░"
echo "░██▄▄▄▄██ ▒██▀▀█▄ ▒▓▓▄ ▄██▒░▓█ ░██ ▒▓█ ▄ ▒██ ▒██ ░ ▐██▓░"
echo " ▓█ ▓██▒░██▓ ▒██▒▒ ▓███▀ ░░▓█▒░██▓░▒████▒▒██▒ ░██▒ ░ ██▒▓░"
echo " ▒▒ ▓▒█░░ ▒▓ ░▒▓░░ ░▒ ▒ ░ ▒ ░░▒░▒░░ ▒░ ░░ ▒░ ░ ░ ██▒▒▒"
echo " ▒ ▒▒ ░ ░▒ ░ ▒░ ░ ▒ ▒ ░▒░ ░ ░ ░ ░░ ░ ░ ▓██ ░▒░"
echo " ░ ▒ ░░ ░ ░ ░ ░░ ░ ░ ░ ░ ▒ ▒ ░░"
echo " ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░"
echo
echo "============================================================="
echo "Each script is a spell that invokes a set of programs."
echo " ─ Paule Macedo"
echo "============================================================="
echo
echo "- The night ritual is about to begin..."
echo "- A dark force awakens to dominate the installation of your machine."
echo "- Feel the ancestral power as you invoke programs and tools."
echo "- With a simple command, system and tool spells will be cast."
echo "- Your journey into the abyss of code has begun. Choose your option below..."
echo
echo package_manager detectado: $package_manager
echo "============================="
echo "1. Install Apps"
echo "2. Install Hyprland Dotfiles"
echo "3. Sync Clock (Localtime)"
echo "0. Exit"
echo
read -p "Choose an option: " choice
case $choice in
1) install_apps_menu ;;
2) install_hyprland_dotfiles_menu ;;
3) sync_windows_clock ;;
0) echo "Exiting..."; exit 0 ;;
*) echo "Invalid option!" ;;
esac
done
}
# Check and install dependencies using package_manager.sh
check_dependencies() {
local dependencies=("bash" "git" "flatpak")
for dep in "${dependencies[@]}"; do
if ! command -v "$dep" &> /dev/null; then
echo "Missing dependency: $dep. Attempting to install..."
install_package "$dep"
fi
done
}
# Executar verificações e menu principal
#check_dependencies
main_menu