LXDE: add Custom packages option and respect existing display manager

- New 'LXDE Custom (Choose packages)' menu entry: fixed base
  (lxde-core + xserver-xorg, lightdm only when no display manager
  is configured) plus a data-driven checklist of 16 extras.
- lxterminal, polkitd, notification-daemon and light-locker stay out
  of the checklist: they arrive via lxde-core Recommends (verified
  against packages.debian.org/trixie, 2026-10-16).
- Full/Core/Custom now honor an already-configured display manager
  via _existing_display_manager (GNOME/KDE pattern): no debconf
  preseed, no lightdm install, no enable over an existing DM.
- Extract _select_packages_checklist helper to utils.sh; XFCE
  Custom consumes it with no functional change.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
stornic56
2026-10-16 11:53:03 -05:00
parent 2195db452a
commit e3a749f38a
3 changed files with 166 additions and 29 deletions
+16 -15
View File
@@ -51,27 +51,28 @@ _install_xfce_wayland() {
}
_install_xfce_custom() {
local -a items=()
for pkg in thunar xfdesktop4 xfwm4 xfce4-panel xfce4-terminal \
xfce4-screenshooter ristretto mousepad xfce4-session \
xfce4-settings xfce4-power-manager; do
items+=("$pkg" "$pkg" "$(_state "$pkg")")
done
local choices
choices=$(_checklist "XFCE Custom" \
"Select the XFCE packages to install:" $TUI_ALTO $TUI_ANCHO $TUI_ALTO_LISTA \
"${items[@]}")
[ -z "$choices" ] && return
# BH-004: helper returns a space-separated selection;
# reparsed into an array to avoid word splitting and injection.
local cleaned
cleaned=$(echo "$choices" | tr -d '"')
cleaned=$(_select_packages_checklist "XFCE Custom" \
"Select the XFCE packages to install:" \
"thunar|File manager" \
"xfdesktop4|Desktop manager" \
"xfwm4|Window manager" \
"xfce4-panel|Panel" \
"xfce4-terminal|Terminal emulator" \
"xfce4-screenshooter|Screenshot tool" \
"ristretto|Image viewer" \
"mousepad|Text editor" \
"xfce4-session|Session manager" \
"xfce4-settings|Settings manager" \
"xfce4-power-manager|Power manager")
[ -z "$cleaned" ] && return
# BH-004: Convert to array to avoid word splitting and injection.
local -a xfce_pkgs=()
local _pkg
while IFS= read -r _pkg; do
[ -n "$_pkg" ] && xfce_pkgs+=("$_pkg")
done < <(echo "$cleaned" | tr ' ' '\n')
# Pre-apply summary: confirm the selection before
# the batch apt transaction starts.
_confirm_install_list "XFCE Custom" "${xfce_pkgs[@]}" || return