From 90e2d8f8d9d3a5976e787b8891cde3d39ed0c9da Mon Sep 17 00:00:00 2001 From: Oliver Lin Date: Sat, 2 May 2026 21:54:33 +0800 Subject: [PATCH] OS (Linux): detects Ubuntu Studio before Kubuntu on KDE systems (#2298) * fix(os): detect Ubuntu Studio before KDE-based flavor checks Add an explicit Ubuntu Studio detection in `getUbuntuFlavour()` by checking for `/usr/share/doc/ubuntustudio-desktop` and setting `name`, `id`, and `idLike` accordingly. This prevents Ubuntu Studio systems from being misidentified as Kubuntu when KDE/Plasma-related XDG config paths are present.fix(os): detect Ubuntu Studio before KDE-based flavor checks Add an explicit Ubuntu Studio detection in `getUbuntuFlavour()` by checking for `/usr/share/doc/ubuntustudio-desktop` and setting `name`, `id`, and `idLike` accordingly. This prevents Ubuntu Studio systems from being misidentified as Kubuntu when KDE/Plasma-related XDG config paths are present. * refactor(os): detect Ubuntu Studio via package presence --- src/detection/os/os_linux.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/detection/os/os_linux.c b/src/detection/os/os_linux.c index f8d9aac3e..081bf89af 100644 --- a/src/detection/os/os_linux.c +++ b/src/detection/os/os_linux.c @@ -99,6 +99,14 @@ FF_A_UNUSED static bool getUbuntuFlavour(FFOSResult* result) { return false; } + if (ffPathExists("/var/lib/dpkg/info/ubuntustudio-desktop.list", FF_PATHTYPE_FILE)) + { + ffStrbufSetStatic(&result->name, "Ubuntu Studio"); + ffStrbufSetStatic(&result->id, "ubuntu-studio"); + ffStrbufSetStatic(&result->idLike, "ubuntu"); + return false; + } + if (ffStrContains(xdgConfigDirs, "kde") || ffStrContains(xdgConfigDirs, "plasma") || ffStrContains(xdgConfigDirs, "kubuntu")) { ffStrbufSetStatic(&result->name, "Kubuntu"); ffStrbufSetStatic(&result->id, "kubuntu");