mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-06 15:25:08 +00:00
fix(install): detect desktops by their metapackages, not name prefixes
The Lite check matched any installed package starting with gnome/kde/ xfce/lxde, so standalone parts (gnome-keyring, xfce4-terminal, lxde-icon-theme) rejected a Lite system. Match whole names of desktop metapackages and session managers instead. Also catch desktops the prefixes missed: Raspberry Pi OS Trixie replaced raspberrypi-ui-mods with rpd-wayland-core / rpd-x-core, Debian tasksel desktops (task-*-desktop), and multi-arch names (plasma-workspace:arm64). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VZNWFWprcFYGfuf1JAyrBJ
This commit is contained in:
@@ -91,11 +91,16 @@ if [ -r "$LM_OS_RELEASE_FILE" ]; then
|
|||||||
DESKTOP_DETECTED=0
|
DESKTOP_DETECTED=0
|
||||||
# grep without -q: -q exits at the first match, dpkg then dies of SIGPIPE,
|
# grep without -q: -q exits at the first match, dpkg then dies of SIGPIPE,
|
||||||
# and pipefail turns a found desktop into "not found".
|
# and pipefail turns a found desktop into "not found".
|
||||||
# Match installed package names from their start: the unanchored ".*kde"
|
# Desktop metapackages and session managers, matched as whole installed
|
||||||
# matched mid-word (libblockdev-* = "bloc-kde-v") on Lite, and `dpkg -l`
|
# package names: an unanchored ".*kde" matched libblockdev-* ("bloc-kde-v"),
|
||||||
# lines also carry descriptions that could match.
|
# and a "gnome" prefix matched standalone parts such as gnome-keyring.
|
||||||
|
# Trixie replaced raspberrypi-ui-mods with the rpd-*-core metapackages.
|
||||||
|
DESKTOP_PACKAGES='raspberrypi-ui-mods|rpd-wayland-core|rpd-x-core'
|
||||||
|
DESKTOP_PACKAGES+='|lxde|lxde-core|lxsession|xfce4|xfce4-session'
|
||||||
|
DESKTOP_PACKAGES+='|gnome-shell|gnome-session|kde-plasma-desktop|plasma-desktop'
|
||||||
|
DESKTOP_PACKAGES+='|plasma-workspace|task-desktop|task-[a-z0-9]+-desktop'
|
||||||
if dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' 2>/dev/null \
|
if dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' 2>/dev/null \
|
||||||
| grep -E "^ii +(raspberrypi-ui-mods|lxde|xfce|gnome|kde)" >/dev/null; then
|
| grep -E "^ii +(${DESKTOP_PACKAGES})(:[a-z0-9]+)?$" >/dev/null; then
|
||||||
DESKTOP_DETECTED=1
|
DESKTOP_DETECTED=1
|
||||||
fi
|
fi
|
||||||
if systemctl list-units --type=service --state=running 2>/dev/null | grep -qE "lightdm|gdm3|sddm|lxdm"; then
|
if systemctl list-units --type=service --state=running 2>/dev/null | grep -qE "lightdm|gdm3|sddm|lxdm"; then
|
||||||
|
|||||||
Reference in New Issue
Block a user