DistroService: rename to HostService

This commit is contained in:
Ly-sec
2025-11-13 15:41:46 +01:00
parent 1288924f87
commit 4fd5865978
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ NIconButton {
if (customIconPath !== "") if (customIconPath !== "")
return customIconPath.startsWith("file://") ? customIconPath : "file://" + customIconPath return customIconPath.startsWith("file://") ? customIconPath : "file://" + customIconPath
if (useDistroLogo) if (useDistroLogo)
return DistroService.osLogo return HostService.osLogo
return "" return ""
} }
visible: source !== "" visible: source !== ""
+1 -1
View File
@@ -233,7 +233,7 @@ ColumnLayout {
} }
NButton { NButton {
visible: !DistroService.isNixOS visible: !HostService.isNixOS
text: I18n.tr("settings.general.launch-setup-wizard") text: I18n.tr("settings.general.launch-setup-wizard")
onClicked: { onClicked: {
var targetScreen = PanelService.openedPanel ? PanelService.openedPanel.screen : (Quickshell.screens.length > 0 ? Quickshell.screens[0] : null) var targetScreen = PanelService.openedPanel ? PanelService.openedPanel.screen : (Quickshell.screens.length > 0 ? Quickshell.screens[0] : null)
@@ -15,7 +15,7 @@ Singleton {
property bool isReady: false property bool isReady: false
function init() { function init() {
Logger.i("DistroService", "Service started") Logger.i("HostService", "Service started")
} }
// Internal helpers // Internal helpers
@@ -81,7 +81,7 @@ Singleton {
return l ? l.split("=")[1].replace(/"/g, "") : "" return l ? l.split("=")[1].replace(/"/g, "") : ""
} }
root.osPretty = val("PRETTY_NAME") || val("NAME") root.osPretty = val("PRETTY_NAME") || val("NAME")
Logger.i("DistroService", root.osPretty) Logger.i("HostService", root.osPretty)
const osId = (val("ID") || "").toLowerCase() const osId = (val("ID") || "").toLowerCase()
root.isNixOS = osId === "nixos" || (root.osPretty || "").toLowerCase().includes("nixos") root.isNixOS = osId === "nixos" || (root.osPretty || "").toLowerCase().includes("nixos")
@@ -91,7 +91,7 @@ Singleton {
} }
root.isReady = true root.isReady = true
} catch (e) { } catch (e) {
Logger.w("DistroService", "failed to read os-release", e) Logger.w("HostService", "failed to read os-release", e)
} }
} }
} }
@@ -102,10 +102,10 @@ Singleton {
const p = String(stdout.text || "").trim() const p = String(stdout.text || "").trim()
if (code === 0 && p) { if (code === 0 && p) {
root.osLogo = `file://${p}` root.osLogo = `file://${p}`
Logger.i("DistroService", "found", root.osLogo) Logger.i("HostService", "found", root.osLogo)
} else { } else {
root.osLogo = "" root.osLogo = ""
Logger.w("DistroService", "none found") Logger.w("HostService", "none found")
} }
} }
stdout: StdioCollector {} stdout: StdioCollector {}
+3 -3
View File
@@ -81,7 +81,7 @@ ShellRoot {
BatteryService.init() BatteryService.init()
IdleInhibitorService.init() IdleInhibitorService.init()
PowerProfileService.init() PowerProfileService.init()
DistroService.init() HostService.init()
FontService.init() FontService.init()
// Only open the setup wizard for new users // Only open the setup wizard for new users
@@ -128,13 +128,13 @@ ShellRoot {
function checkSetupWizard() { function checkSetupWizard() {
// Wait for distro service // Wait for distro service
if (!DistroService.isReady) { if (!HostService.isReady) {
Qt.callLater(checkSetupWizard) Qt.callLater(checkSetupWizard)
return return
} }
// No setup wizard on NixOS // No setup wizard on NixOS
if (DistroService.isNixOS) { if (HostService.isNixOS) {
Settings.data.setupCompleted = true Settings.data.setupCompleted = true
return return
} }