Files
Omeron/modules/core/packages.sh
Pepe44DEV be7bffc1e5 Initial commit: Omeron modular Hyprland setup framework
- Modular installer with gum-based TUI
- Fresh-install detection with auto GPU driver selection
- Preflight module for system detection (Intel/AMD/NVIDIA)
- Core modules: packages, dotfiles, services, SDDM
- Optional software installer (Obsidian, Neovim, VS Code, etc.)
- Homelab config module with dynamic AGS integration
- Two complete themes: Forest Neon and Rose Night
- 19 Hyprland control scripts + 4 AGS widgets
- Idempotent dotfile deployment with automatic backup
- YAML-based configuration, extensible module system
- Full logging to ~/.local/share/omeron/
2026-05-27 20:51:58 +02:00

192 lines
4.2 KiB
Bash
Executable File

#!/usr/bin/env bash
module_description() {
printf "System Packages - install Hyprland, GPU drivers, and all dependencies\n"
}
module_required() { return 0; }
module_should_skip() { return 1; }
module_prereqs() {
require pacman pacman
is_arch || {
log_error "This module requires an Arch-based system"
return 1
}
}
module_main() {
log_section "Package Installation"
local groups=()
local all_packages=()
if ((OMERON_FRESH_INSTALL)); then
tui_format "#{bold}Fresh install mode — installing everything#{normal}"
groups=(
"hyprland"
"gpu"
"audio"
"network"
"fonts"
"tools"
"qt"
"development"
)
else
tui_format "#{bold}Existing system — checking for missing packages#{normal}"
groups=(
"hyprland"
"audio"
"network"
"tools"
)
fi
for group in "${groups[@]}"; do
local pkgs=()
mapfile -t pkgs < <(get_group_packages "$group")
all_packages+=("${pkgs[@]}")
done
all_packages=("$(remove_duplicates "${all_packages[@]}")")
local total=${#all_packages[@]}
local existing=0
local missing=0
local pkg
for pkg in "${all_packages[@]}"; do
if is_package_installed "$pkg"; then
((existing++))
else
((missing++))
fi
done
tui_format ""
tui_format "#{bold}Package Summary:#{normal}"
tui_format " Total packages: ${total}"
tui_format " Already installed: ${existing}"
tui_format " To install: ${missing}"
tui_format ""
if ((missing == 0)); then
log_success "All packages already installed"
return 0
fi
if ! tui_confirm "Install ${missing} missing packages?"; then
log_info "Package installation skipped by user"
return 0
fi
if ((OMERON_FRESH_INSTALL)); then
log_info "Running system update first..."
sudo_run pacman -Syu --noconfirm 2>&1 | tail -3 || true
fi
local pacman_pkgs=()
local aur_pkgs=()
local gpu_pkgs=()
for pkg in "${all_packages[@]}"; do
if is_package_installed "$pkg"; then
continue
fi
if pacman -Si "$pkg" >/dev/null 2>&1; then
pacman_pkgs+=("$pkg")
else
aur_pkgs+=("$pkg")
fi
done
if ((${#pacman_pkgs[@]})); then
log_info "Installing ${#pacman_pkgs[@]} pacman packages..."
tui_spin "Installing core packages..." sudo_run pacman -S --needed --noconfirm "${pacman_pkgs[@]}"
log_success "Core packages installed"
fi
if ((${#aur_pkgs[@]})); then
if have paru || have yay; then
log_info "Installing ${#aur_pkgs[@]} AUR packages..."
install_aur "${aur_pkgs[@]}" || log_warn "Some AUR packages may not have been installed"
else
log_warn "No AUR helper found. Install manually: ${aur_pkgs[*]}"
fi
fi
log_success "Package installation complete"
log_info "Installed: $((missing - ${#aur_pkgs[@]})) | AUR/optional: ${#aur_pkgs[@]}"
}
get_group_packages() {
local group="$1"
case "$group" in
hyprland)
printf '%s\n' \
hyprland hyprpaper hyprlock hypridle \
waybar wofi swaync kitty \
brightnessctl playerctl \
grim slurp swappy hyprshot \
wl-clipboard libnotify sshpass
;;
gpu)
gpu_packages
printf '%s\n' \
mesa mesa-utils \
vulkan-tools vulkan-icd-loader \
libva-utils
;;
audio)
printf '%s\n' \
pipewire pipewire-pulse pipewire-alsa pipewire-jack \
wireplumber pavucontrol helvum \
sof-firmware
;;
network)
printf '%s\n' \
networkmanager network-manager-applet \
bluez bluez-utils blueman
;;
fonts)
printf '%s\n' \
noto-fonts noto-fonts-emoji ttf-jetbrains-mono-nerd \
ttf-font-awesome ttf-nerd-fonts-symbols ttf-dejavu
;;
tools)
printf '%s\n' \
nautilus papirus-icon-theme starship \
python-gobject gtk3 gtk4 \
polkit-gnome xdg-desktop-portal xdg-desktop-portal-hyprland \
qt5ct qt6ct \
gum
;;
qt)
printf '%s\n' \
qt5-wayland qt6-wayland \
qt5-base qt6-base
;;
development)
printf '%s\n' \
git base-devel \
zip unzip unrar p7zip \
ripgrep fd bat lsd \
htop btop fastfetch
;;
esac
}
remove_duplicates() {
printf '%s\n' "$@" | sort -u
}