Files
Omeron/modules/post/apply-theme.sh
Pepe44DEV a819973018 fix: wofi-theme + wallpaper + ai-command-center source entfernt
Drei Fixes:

1. ai-command-center.conf aus hyprland.conf entfernt
   (existiert nicht auf frischer VM -> source= globbing error)

2. hyprpaper.conf in standard hyprpaper Format geschrieben
   (preload=/wallpaper= statt awww-block-format)
   awww.conf wird separat geschrieben falls awww installiert ist

3. apply-theme.sh Fehlerbehandlung: tui_spin || return 1
   (vorher wurde immer 'Theme applied' gemeldet auch bei Fehler)

4. replace_home_paths auch fuer wofi/ hinzugefuegt
2026-05-28 18:00:19 +02:00

94 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env bash
module_description() {
printf "Apply Theme - select and apply a Hyprland theme\n"
}
module_required() { return 1; }
module_should_skip() { return 1; }
module_prereqs() {
return 0
}
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 theme_files=()
mapfile -t theme_files < <(find "$themes_dir" -name '*.theme' -type f | sort 2>/dev/null)
if ((${#theme_files[@]} == 0)); then
log_warn "No theme files found in $themes_dir"
return 1
fi
local theme_names=()
local file
for file in "${theme_files[@]}"; do
theme_names+=("$(basename "$file" .theme)")
done
tui_bold "Available themes:"
local i
for i in "${!theme_names[@]}"; do
tui_info "[$i] ${theme_names[$i]}"
done
printf '\n'
local choice
if ((${#theme_files[@]} == 1)); then
tui_info "Only one theme available, auto-selecting: ${theme_names[0]}"
choice="${theme_files[0]}"
else
choice="$(
local labels=()
for name in "${theme_names[@]}"; do
labels+=("$name")
done
tui_choose "Select a theme" "${labels[@]}"
)"
if [[ -z "$choice" ]]; then
log_info "No theme selected, skipping"
return 0
fi
local idx
for idx in "${!theme_names[@]}"; do
if [[ "$choice" == "${theme_names[$idx]}" ]]; then
choice="${theme_files[$idx]}"
break
fi
done
fi
if [[ -z "$choice" || ! -f "$choice" ]]; then
log_warn "Invalid theme selection"
return 1
fi
log_info "Selected theme: $(basename "$choice" .theme)"
if ! tui_confirm "Apply theme: $(basename "$choice" .theme)?"; then
log_info "Theme application skipped"
return 0
fi
sudo_run mkdir -p /var/lib/pascal-sddm-theme 2>/dev/null || true
sudo_run chown "$(id -u):$(id -g)" /var/lib/pascal-sddm-theme 2>/dev/null || true
log_info "Applying theme..."
if ! tui_spin "Applying theme..." bash "$theme_script" --apply "$choice"; then
log_warn "Theme application returned errors"
return 1
fi
log_success "Theme applied: $(basename "$choice" .theme)"
}