Files
Omeron/modules/core/sddm.sh
Pepe44DEV 382747ba9b fix: theme-Auswahl + SDDM-Theme-Correctness
Drei Probleme gefixt:

1. Theme-Auswahl waehrend Install
   - apply-theme.sh zeigt jetzt alle .theme-Files via tui_choose
   - Benutzer waehlt interaktiv (gum/whiptail/basic)
   - Bei nur einem Theme: auto-select

2. SDDM wendet falsches Theme an
   - sddm.sh erzeugt /var/lib/pascal-sddm-theme/ mit user chown
   - Liest current-theme.conf + hyprpaper.conf fuer aktuelle Farben
   - Schreibt theme.conf in /usr/share/sddm/themes/pascal-hypr/
   - Config heisst jetzt 90-pascal-hypr.conf (hoehere Priority)
   - apply-theme.sh erzeugt state dir VOR theme-menu.sh --apply

3. tui_choose basic mode fix
   - ${!choice} funktioniert nicht fuer numerische Indices
   - labels+=("$@") + ${labels[$choice]} statt Positional-Params
2026-05-27 23:23:55 +02:00

118 lines
3.2 KiB
Bash
Executable File

#!/usr/bin/env bash
module_description() {
printf "SDDM Theme - install custom login theme with current colors\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/
sudo_run mkdir -p /var/lib/pascal-sddm-theme
sudo_run chown "$(id -u):$(id -g)" /var/lib/pascal-sddm-theme
local current_theme_conf="$HOME/.config/hypr/current-theme.conf"
local current_wallpaper="$HOME/.config/hypr/current-wallpaper"
local hyprpaper_conf="$HOME/.config/hypr/hyprpaper.conf"
local wallpaper=""
local accent="#f38ba8"
local accent2="#cba6f7"
local background="#18141f"
local panel="#313244"
local foreground="#f5e0dc"
local muted="#cdd6f4"
local selected="#11111b"
local theme_name="Pascal Hypr"
if [[ -f "$current_wallpaper" ]]; then
wallpaper="$(< "$current_wallpaper")"
fi
if [[ -f "$current_theme_conf" ]]; then
local line
while IFS= read -r line; do
[[ "$line" =~ ^# ]] && continue
[[ "$line" =~ ^[[:space:]]*$ ]] && continue
if [[ "$line" =~ col\.active_border[[:space:]]*=[[:space:]]*(.*) ]]; then
local border="${BASH_REMATCH[1]}"
border="${border#rgba(}"
border="${border%ee)}"
accent="#${border:0:2}${border:2:2}${border:4:2}"
fi
done < "$current_theme_conf"
fi
if [[ -f "$hyprpaper_conf" ]]; then
if [[ -z "$wallpaper" ]]; then
local wl
wl="$(grep 'path' "$hyprpaper_conf" 2>/dev/null | head -1 | sed 's/.*=[[:space:]]*//' | tr -d ' "')"
[[ -n "$wl" ]] && wallpaper="$wl"
fi
if [[ "$wallpaper" == /home/pascal/* ]]; then
wallpaper="${wallpaper/#\/home\/pascal/$HOME}"
fi
fi
if [[ -n "$wallpaper" && -f "$wallpaper" ]]; then
local ext="${wallpaper##*.}"
[[ "$ext" == "$wallpaper" ]] && ext="jpg"
sudo_run cp "$wallpaper" "/var/lib/pascal-sddm-theme/wallpaper.$ext"
fi
local theme_conf="/usr/share/sddm/themes/pascal-hypr/theme.conf"
sudo_run tee "$theme_conf" >/dev/null <<SDDMEOF
[General]
background=/var/lib/pascal-sddm-theme/wallpaper.jpg
themeName=$theme_name
accent=$accent
accent2=$accent2
backgroundColor=$background
panelColor=$panel
foreground=$foreground
muted=$muted
selectedText=$selected
SDDMEOF
if [[ -f "$sddm_theme_dir/sddm.conf" ]]; then
sudo_run cp -a "$sddm_theme_dir/sddm.conf" /etc/sddm.conf.d/90-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
}