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/
This commit is contained in:
84
modules/core/dotfiles.sh
Executable file
84
modules/core/dotfiles.sh
Executable file
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() {
|
||||
printf "Dotfiles - deploy configuration files to ~/.config\n"
|
||||
}
|
||||
|
||||
module_required() { return 0; }
|
||||
module_should_skip() { return 1; }
|
||||
|
||||
module_prereqs() {
|
||||
return 0
|
||||
}
|
||||
|
||||
module_main() {
|
||||
log_section "Dotfile Deployment"
|
||||
|
||||
local dotfiles_dir="$OMERON_PROJECT_DIR/dotfiles"
|
||||
local config_items=()
|
||||
local backup_dir
|
||||
|
||||
if [[ -f "$OMERON_PROJECT_DIR/config/omeron.yaml" ]] && command -v python3 >/dev/null 2>&1; then
|
||||
log_info "Loading config items from omeron.yaml"
|
||||
config_items=()
|
||||
local raw_items
|
||||
raw_items="$(python3 -c "
|
||||
import yaml
|
||||
with open('$OMERON_PROJECT_DIR/config/omeron.yaml') as f:
|
||||
data = yaml.safe_load(f)
|
||||
items = data.get('dotfiles', {}).get('items', [])
|
||||
print(' '.join(items))
|
||||
" 2>/dev/null)"
|
||||
|
||||
if [[ -n "$raw_items" ]]; then
|
||||
read -ra config_items <<< "$raw_items"
|
||||
fi
|
||||
fi
|
||||
|
||||
if ((${#config_items[@]} == 0)); then
|
||||
config_items=(hypr waybar wofi swaync kitty gtk-3.0 gtk-4.0 qt5ct qt6ct)
|
||||
fi
|
||||
|
||||
if ! tui_confirm "Deploy dotfiles to ~/.config? (existing files will be backed up)"; then
|
||||
log_info "Dotfile deployment skipped by user"
|
||||
return 0
|
||||
fi
|
||||
|
||||
backup_dir="$(backup_file "$HOME/.config/hypr" "$HOME/.dotfiles-backup/$(date +%Y%m%d-%H%M%S)")"
|
||||
backup_dir="$(dirname "$backup_dir" 2>/dev/null || printf '%s' "$HOME/.dotfiles-backup/$(date +%Y%m%d-%H%M%S)")"
|
||||
|
||||
for item in "${config_items[@]}"; do
|
||||
local source="$dotfiles_dir/$item"
|
||||
local target="$HOME/.config/$item"
|
||||
|
||||
if [[ ! -d "$source" ]] && [[ ! -f "$source" ]]; then
|
||||
log_warn "Source not found: $source"
|
||||
continue
|
||||
fi
|
||||
|
||||
log_info "Deploying $item..."
|
||||
copy_path "$source" "$target"
|
||||
done
|
||||
|
||||
if [[ -f "$dotfiles_dir/starship.toml" ]]; then
|
||||
copy_path "$dotfiles_dir/starship.toml" "$HOME/.config/starship.toml"
|
||||
fi
|
||||
|
||||
local wallpaper_source="$dotfiles_dir/wallpapers"
|
||||
local wallpaper_target="$HOME/Bilder/Wallpaper"
|
||||
if [[ -d "$wallpaper_source" ]]; then
|
||||
copy_path "$wallpaper_source" "$wallpaper_target"
|
||||
fi
|
||||
|
||||
chmod +x "$HOME/.config/hypr/Scripts/"*.sh 2>/dev/null || true
|
||||
chmod +x "$HOME/.config/hypr/Scripts/"*.py 2>/dev/null || true
|
||||
chmod +x "$HOME/.config/waybar/scripts/"*.sh 2>/dev/null || true
|
||||
|
||||
replace_home_paths "$HOME/.config/hypr" "/home/pascal"
|
||||
replace_home_paths "$HOME/.config/gtk-3.0" "/home/pascal"
|
||||
replace_home_paths "$HOME/.config/gtk-4.0" "/home/pascal"
|
||||
replace_home_paths "$HOME/.config/qt5ct" "/home/pascal"
|
||||
replace_home_paths "$HOME/.config/qt6ct" "/home/pascal"
|
||||
|
||||
log_success "Dotfiles deployed (backup: $backup_dir)"
|
||||
}
|
||||
191
modules/core/packages.sh
Executable file
191
modules/core/packages.sh
Executable file
@@ -0,0 +1,191 @@
|
||||
#!/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
|
||||
}
|
||||
106
modules/core/preflight.sh
Executable file
106
modules/core/preflight.sh
Executable file
@@ -0,0 +1,106 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
OMERON_FRESH_INSTALL=0
|
||||
OMERON_DETECTED_GPU=""
|
||||
|
||||
module_description() {
|
||||
printf "System Preflight - detect system state and missing 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 "System Preflight Check"
|
||||
|
||||
OMERON_DETECTED_GPU="$(detect_gpu)"
|
||||
export OMERON_DETECTED_GPU
|
||||
|
||||
system_summary
|
||||
|
||||
if is_fresh_install; then
|
||||
OMERON_FRESH_INSTALL=1
|
||||
export OMERON_FRESH_INSTALL
|
||||
|
||||
tui_format ""
|
||||
tui_format "#{bold}#{yellow}⚠ Fresh system detected!#{normal}"
|
||||
tui_format "Hyprland is not installed and no desktop session is running."
|
||||
tui_format ""
|
||||
|
||||
local gpu_name
|
||||
gpu_name="$(lspci -nn 2>/dev/null | grep -i 'vga\|3d\|display' | sed 's/.*: //' | head -1 || echo "unknown")"
|
||||
|
||||
tui_format "#{bold}This installation will:#{normal}"
|
||||
tui_format " • Hyprland compositor + tools"
|
||||
tui_format " • GPU drivers for: ${gpu_name}"
|
||||
tui_format " • Audio system (PipeWire)"
|
||||
tui_format " • Network services (NetworkManager)"
|
||||
tui_format " • Fonts and icon themes"
|
||||
tui_format " • Dotfiles deployment"
|
||||
tui_format ""
|
||||
|
||||
if ! tui_confirm "Proceed with full system setup?"; then
|
||||
log_info "Fresh installation aborted by user"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! have paru && ! have yay; then
|
||||
log_info "No AUR helper found. Installing paru..."
|
||||
install_aur_helper
|
||||
fi
|
||||
|
||||
if ! have gum; then
|
||||
log_info "Installing gum for better TUI..."
|
||||
sudo_run pacman -S --needed --noconfirm gum 2>/dev/null || true
|
||||
tui_style
|
||||
fi
|
||||
|
||||
log_success "Preflight complete — ready for full installation"
|
||||
else
|
||||
tui_format ""
|
||||
tui_format "#{bold}#{green}✓ Existing Hyprland system detected#{normal}"
|
||||
tui_format "Will check for missing packages and updates."
|
||||
tui_format ""
|
||||
fi
|
||||
}
|
||||
|
||||
install_aur_helper() {
|
||||
if have paru || have yay; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! command -v git >/dev/null 2>&1; then
|
||||
sudo_run pacman -S --needed --noconfirm git base-devel
|
||||
fi
|
||||
|
||||
local build_dir
|
||||
build_dir="$(mktemp -d)"
|
||||
|
||||
log_info "Building paru from AUR..."
|
||||
sudo_run pacman -S --needed --noconfirm rustup 2>/dev/null || true
|
||||
|
||||
if have rustup; then
|
||||
rustup default stable >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
if git clone https://aur.archlinux.org/paru.git "$build_dir/paru" 2>/dev/null; then
|
||||
(cd "$build_dir/paru" && makepkg -si --needed --noconfirm) 2>&1 | tail -5 || {
|
||||
log_warn "paru build failed, trying yay..."
|
||||
if git clone https://aur.archlinux.org/yay.git "$build_dir/yay" 2>/dev/null; then
|
||||
(cd "$build_dir/yay" && makepkg -si --needed --noconfirm) 2>&1 | tail -5 || {
|
||||
log_warn "yay build failed too. Install manually: paru -S paru-bin"
|
||||
}
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
rm -rf "$build_dir"
|
||||
}
|
||||
50
modules/core/sddm.sh
Executable file
50
modules/core/sddm.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() {
|
||||
printf "SDDM Theme - install custom login theme\n"
|
||||
}
|
||||
|
||||
module_required() { return 1; }
|
||||
module_should_skip() {
|
||||
if have sddm; then
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
module_prereqs() {
|
||||
if ! have sddm; then
|
||||
log_warn "SDDM is not installed. Install with: sudo pacman -S sddm"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
module_main() {
|
||||
log_section "SDDM Theme Installation"
|
||||
|
||||
local sddm_theme_dir="$OMERON_PROJECT_DIR/dotfiles/hypr/sddm-theme"
|
||||
|
||||
if [[ ! -d "$sddm_theme_dir/pascal-hypr" ]]; then
|
||||
log_warn "SDDM theme not found at $sddm_theme_dir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
log_info "Installing SDDM theme..."
|
||||
sudo_run mkdir -p /usr/share/sddm/themes /etc/sddm.conf.d
|
||||
|
||||
if [[ -d "/usr/share/sddm/themes/pascal-hypr" ]]; then
|
||||
sudo_run rm -rf "/usr/share/sddm/themes/pascal-hypr"
|
||||
fi
|
||||
|
||||
sudo_run cp -a "$sddm_theme_dir/pascal-hypr" /usr/share/sddm/themes/
|
||||
|
||||
if [[ -f "$sddm_theme_dir/sddm.conf" ]]; then
|
||||
sudo_run cp -a "$sddm_theme_dir/sddm.conf" /etc/sddm.conf.d/10-pascal-hypr.conf
|
||||
fi
|
||||
|
||||
log_success "SDDM theme installed"
|
||||
|
||||
if tui_confirm "Enable SDDM as display manager?"; then
|
||||
sudo_run systemctl enable sddm --now 2>/dev/null || log_warn "Could not enable SDDM"
|
||||
fi
|
||||
}
|
||||
52
modules/core/services.sh
Executable file
52
modules/core/services.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() {
|
||||
printf "System Services - enable and start NetworkManager and Bluetooth\n"
|
||||
}
|
||||
|
||||
module_required() { return 0; }
|
||||
module_should_skip() {
|
||||
have systemctl || return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
module_prereqs() {
|
||||
require systemctl systemd
|
||||
}
|
||||
|
||||
module_main() {
|
||||
log_section "System Services"
|
||||
|
||||
local services=("NetworkManager.service" "bluetooth.service")
|
||||
|
||||
if [[ -f "$OMERON_PROJECT_DIR/config/omeron.yaml" ]] && command -v python3 >/dev/null 2>&1; then
|
||||
local raw_services
|
||||
raw_services="$(python3 -c "
|
||||
import yaml
|
||||
with open('$OMERON_PROJECT_DIR/config/omeron.yaml') as f:
|
||||
data = yaml.safe_load(f)
|
||||
svcs = data.get('services', [])
|
||||
print(' '.join(svcs))
|
||||
" 2>/dev/null)"
|
||||
|
||||
if [[ -n "$raw_services" ]]; then
|
||||
read -ra services <<< "$raw_services"
|
||||
for i in "${!services[@]}"; do
|
||||
if ! [[ "${services[$i]}" == *".service" ]]; then
|
||||
services[$i]="${services[$i]}.service"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
for svc in "${services[@]}"; do
|
||||
log_info "Enabling $svc..."
|
||||
if sudo_run systemctl enable --now "$svc" >/dev/null 2>&1; then
|
||||
log_success "$svc enabled and started"
|
||||
else
|
||||
log_warn "Failed to enable $svc (may already be running)"
|
||||
fi
|
||||
done
|
||||
|
||||
log_success "Services configured"
|
||||
}
|
||||
78
modules/homelab/setup.sh
Executable file
78
modules/homelab/setup.sh
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() {
|
||||
printf "Homelab Configuration - set up Unraid server access\n"
|
||||
}
|
||||
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
|
||||
module_prereqs() {
|
||||
return 0
|
||||
}
|
||||
|
||||
module_main() {
|
||||
log_section "Homelab Configuration"
|
||||
|
||||
local homelab_config_dir="$HOME/.config/homelab"
|
||||
local homelab_config_file="$homelab_config_dir/config.yaml"
|
||||
|
||||
tui_format "#{bold}Homelab Control Center Setup#{normal}"
|
||||
tui_format "This configures SSH access and connection details to your Unraid server."
|
||||
tui_format ""
|
||||
|
||||
local server_address server_username
|
||||
|
||||
server_address="$(tui_input "Server address (IP or domain)")"
|
||||
if [[ -z "$server_address" ]]; then
|
||||
log_info "Homelab setup skipped (no server address)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
server_username="$(tui_input "SSH username")"
|
||||
if [[ -z "$server_username" ]]; then
|
||||
server_username="root"
|
||||
fi
|
||||
|
||||
mkdir -p "$homelab_config_dir"
|
||||
|
||||
cat > "$homelab_config_file" <<CONFIG
|
||||
# Homelab Configuration
|
||||
# Generated by Omeron on $(date --rfc-3339=seconds)
|
||||
|
||||
server:
|
||||
address: "${server_address}"
|
||||
username: "${server_username}"
|
||||
port: 22
|
||||
|
||||
control_center:
|
||||
refresh_interval: 5
|
||||
theme: "dark"
|
||||
|
||||
features:
|
||||
docker: true
|
||||
services: true
|
||||
storage: true
|
||||
network: true
|
||||
monitoring: true
|
||||
CONFIG
|
||||
|
||||
log_success "Homelab configuration saved to $homelab_config_file"
|
||||
|
||||
tui_format ""
|
||||
tui_format "#{bold}Configuration Summary:#{normal}"
|
||||
tui_format " Server address: ${server_address}"
|
||||
tui_format " SSH username: ${server_username}"
|
||||
tui_format ""
|
||||
tui_format "You can edit the configuration anytime at:"
|
||||
tui_format " ${homelab_config_file}"
|
||||
|
||||
if tui_confirm "Test SSH connection to ${server_username}@${server_address}?"; then
|
||||
log_info "Testing SSH connection..."
|
||||
if ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=accept-new "${server_username}@${server_address}" "echo OK" 2>&1; then
|
||||
log_success "SSH connection successful"
|
||||
else
|
||||
log_warn "SSH connection failed. You may need to set up SSH keys or the server may not be reachable."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
74
modules/optional/install.sh
Executable file
74
modules/optional/install.sh
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() {
|
||||
printf "Optional Software - select and install additional packages\n"
|
||||
}
|
||||
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
|
||||
module_prereqs() {
|
||||
return 0
|
||||
}
|
||||
|
||||
module_main() {
|
||||
log_section "Optional Software Selection"
|
||||
|
||||
tui_format "#{bold}Select software to install:#{normal}"
|
||||
tui_format "Use space to select, enter to confirm."
|
||||
tui_format ""
|
||||
|
||||
local choices
|
||||
choices="$(
|
||||
gum choose --no-limit \
|
||||
--header "Select optional packages (space to toggle, enter to confirm)" \
|
||||
"Obsidian" \
|
||||
"Neovim" \
|
||||
"Visual Studio Code" \
|
||||
"Spotify" \
|
||||
"Brave Browser" \
|
||||
"Chromium" \
|
||||
"VLC" \
|
||||
"PipeWire Tools" \
|
||||
"Docker" \
|
||||
"Blender" 2>&1
|
||||
)"
|
||||
|
||||
if [[ -z "$choices" ]]; then
|
||||
log_info "No optional software selected"
|
||||
return 0
|
||||
fi
|
||||
|
||||
log_info "Selected: $(printf '%s' "$choices" | tr '\n' ' ')"
|
||||
|
||||
while IFS= read -r selection; do
|
||||
[[ -z "$selection" ]] && continue
|
||||
local module_script="$OMERON_PROJECT_DIR/modules/optional/packages/$(echo "$selection" | tr '[:upper:]' '[:lower:]' | tr ' ' '-').sh"
|
||||
if [[ -f "$module_script" ]]; then
|
||||
log_info "Running installer for: $selection"
|
||||
module_run "$module_script"
|
||||
else
|
||||
log_warn "No installer found for: $selection"
|
||||
local pkg_name="${selection,,}"
|
||||
pkg_name="${pkg_name// /-}"
|
||||
install_standard_package "$selection" "$pkg_name"
|
||||
fi
|
||||
done <<< "$choices"
|
||||
|
||||
log_success "Optional software installation complete"
|
||||
}
|
||||
|
||||
install_standard_package() {
|
||||
local display_name="$1"
|
||||
local pkg_name="$2"
|
||||
|
||||
if tui_confirm "Install $display_name (searching pacman)?"; then
|
||||
if pacman -Si "$pkg_name" >/dev/null 2>&1; then
|
||||
install_pacman "$pkg_name"
|
||||
log_success "$display_name installed"
|
||||
else
|
||||
log_info "$pkg_name not in pacman, trying AUR..."
|
||||
install_aur "$pkg_name" 2>/dev/null || log_warn "Could not install $display_name"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
18
modules/optional/packages/brave-browser.sh
Executable file
18
modules/optional/packages/brave-browser.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() { printf "Install Brave Browser\n"; }
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
module_prereqs() { return 0; }
|
||||
|
||||
module_main() {
|
||||
log_info "Installing Brave Browser..."
|
||||
|
||||
if pacman -Si brave-browser >/dev/null 2>&1; then
|
||||
install_pacman brave-browser
|
||||
elif pacman -Si brave-bin >/dev/null 2>&1; then
|
||||
install_pacman brave-bin
|
||||
else
|
||||
install_aur brave-bin
|
||||
fi
|
||||
}
|
||||
11
modules/optional/packages/chromium.sh
Executable file
11
modules/optional/packages/chromium.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() { printf "Install Chromium\n"; }
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
module_prereqs() { return 0; }
|
||||
|
||||
module_main() {
|
||||
log_info "Installing Chromium..."
|
||||
install_pacman chromium
|
||||
}
|
||||
11
modules/optional/packages/neovim.sh
Executable file
11
modules/optional/packages/neovim.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() { printf "Install Neovim\n"; }
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
module_prereqs() { return 0; }
|
||||
|
||||
module_main() {
|
||||
log_info "Installing Neovim..."
|
||||
install_pacman neovim
|
||||
}
|
||||
17
modules/optional/packages/obsidian.sh
Executable file
17
modules/optional/packages/obsidian.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() { printf "Install Obsidian\n"; }
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
module_prereqs() { return 0; }
|
||||
|
||||
module_main() {
|
||||
log_info "Installing Obsidian..."
|
||||
if pacman -Si obsidian >/dev/null 2>&1; then
|
||||
install_pacman obsidian
|
||||
elif pacman -Si obsidian-bin >/dev/null 2>&1; then
|
||||
install_pacman obsidian-bin
|
||||
else
|
||||
install_aur obsidian-bin
|
||||
fi
|
||||
}
|
||||
43
modules/optional/packages/pipewire-tools.sh
Executable file
43
modules/optional/packages/pipewire-tools.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() { printf "Install PipeWire audio tools\n"; }
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
module_prereqs() { return 0; }
|
||||
|
||||
module_main() {
|
||||
log_section "PipeWire Audio Tools"
|
||||
|
||||
local packages=(
|
||||
pipewire
|
||||
pipewire-pulse
|
||||
pipewire-alsa
|
||||
pipewire-jack
|
||||
wireplumber
|
||||
pavucontrol
|
||||
helvum
|
||||
easyeffects
|
||||
)
|
||||
|
||||
local to_install=()
|
||||
local pkg
|
||||
|
||||
for pkg in "${packages[@]}"; do
|
||||
if pacman -Si "$pkg" >/dev/null 2>&1 && ! is_package_installed "$pkg"; then
|
||||
to_install+=("$pkg")
|
||||
fi
|
||||
done
|
||||
|
||||
if ((${#to_install[@]})); then
|
||||
log_info "Installing PipeWire tools: ${to_install[*]}"
|
||||
install_pacman "${to_install[@]}"
|
||||
log_success "PipeWire tools installed"
|
||||
else
|
||||
log_info "All PipeWire tools already installed"
|
||||
fi
|
||||
|
||||
if have systemctl; then
|
||||
systemctl --user enable --now pipewire pipewire-pulse wireplumber 2>/dev/null || true
|
||||
log_info "PipeWire services enabled"
|
||||
fi
|
||||
}
|
||||
18
modules/optional/packages/spotify.sh
Executable file
18
modules/optional/packages/spotify.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() { printf "Install Spotify\n"; }
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
module_prereqs() { return 0; }
|
||||
|
||||
module_main() {
|
||||
log_info "Installing Spotify..."
|
||||
|
||||
if pacman -Si spotify >/dev/null 2>&1; then
|
||||
install_pacman spotify
|
||||
elif pacman -Si spotify-launcher >/dev/null 2>&1; then
|
||||
install_pacman spotify-launcher
|
||||
else
|
||||
install_aur spotify-launcher
|
||||
fi
|
||||
}
|
||||
18
modules/optional/packages/visual-studio-code.sh
Executable file
18
modules/optional/packages/visual-studio-code.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() { printf "Install Visual Studio Code\n"; }
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
module_prereqs() { return 0; }
|
||||
|
||||
module_main() {
|
||||
log_info "Installing Visual Studio Code..."
|
||||
|
||||
if pacman -Si code >/dev/null 2>&1; then
|
||||
install_pacman code
|
||||
elif pacman -Si visual-studio-code-bin >/dev/null 2>&1; then
|
||||
install_pacman visual-studio-code-bin
|
||||
else
|
||||
install_aur visual-studio-code-bin
|
||||
fi
|
||||
}
|
||||
11
modules/optional/packages/vlc.sh
Executable file
11
modules/optional/packages/vlc.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() { printf "Install VLC\n"; }
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
module_prereqs() { return 0; }
|
||||
|
||||
module_main() {
|
||||
log_info "Installing VLC..."
|
||||
install_pacman vlc
|
||||
}
|
||||
60
modules/post/apply-theme.sh
Executable file
60
modules/post/apply-theme.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
module_description() {
|
||||
printf "Apply Theme - set default Hyprland theme and restart services\n"
|
||||
}
|
||||
|
||||
module_required() { return 1; }
|
||||
module_should_skip() { return 1; }
|
||||
|
||||
module_prereqs() {
|
||||
if ! have hyprctl && ! have notify-send; then
|
||||
log_warn "Neither hyprctl nor notify-send found. Theme can still be applied later."
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
module_main() {
|
||||
log_section "Theme Application"
|
||||
|
||||
local theme_script="$HOME/.config/hypr/Scripts/theme-menu.sh"
|
||||
local themes_dir="$HOME/.config/hypr/Themes"
|
||||
|
||||
if [[ ! -f "$theme_script" ]]; then
|
||||
log_warn "Theme script not found (dotfiles may not be deployed yet)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local default_theme="${OMERON_DEFAULT_THEME:-forest-neon}"
|
||||
|
||||
local theme_file=""
|
||||
if [[ -f "$themes_dir/$default_theme.theme" ]]; then
|
||||
theme_file="$themes_dir/$default_theme.theme"
|
||||
elif [[ -f "$themes_dir/forest-neon.theme" ]]; then
|
||||
theme_file="$themes_dir/forest-neon.theme"
|
||||
elif [[ -f "$themes_dir/rose-night.theme" ]]; then
|
||||
theme_file="$themes_dir/rose-night.theme"
|
||||
else
|
||||
local available
|
||||
available="$(find "$themes_dir" -name '*.theme' -type f | head -1)"
|
||||
if [[ -n "$available" ]]; then
|
||||
theme_file="$available"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "$theme_file" ]]; then
|
||||
log_warn "No theme files found in $themes_dir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if tui_confirm "Apply theme: $(basename "$theme_file" .theme).theme?"; then
|
||||
log_info "Applying theme: $(basename "$theme_file")"
|
||||
tui_spin "Applying theme..." bash "$theme_script" --apply "$theme_file"
|
||||
|
||||
if have notify-send; then
|
||||
notify-send "Omeron" "Theme applied: $(basename "$theme_file" .theme)" >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
log_success "Theme applied: $(basename "$theme_file" .theme)"
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user