1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-11 07:52:50 -05:00

more re-work to settings

This commit is contained in:
bbedward
2025-08-19 23:44:44 -04:00
parent 2c99fbd50f
commit b45a7709bb
6 changed files with 873 additions and 296 deletions

View File

@@ -632,7 +632,47 @@ Singleton {
}
}
Process {
id: osReleaseProcess
command: ["cat", "/etc/os-release"]
running: false
onExited: exitCode => {
if (exitCode !== 0) {
console.warn("Failed to read /etc/os-release")
}
}
stdout: StdioCollector {
onStreamFinished: {
if (text.trim()) {
try {
const lines = text.trim().split('\n')
let prettyName = ""
let name = ""
for (const line of lines) {
const trimmedLine = line.trim()
if (trimmedLine.startsWith('PRETTY_NAME=')) {
prettyName = trimmedLine.substring(12).replace(/^["']|["']$/g, '')
} else if (trimmedLine.startsWith('NAME=')) {
name = trimmedLine.substring(5).replace(/^["']|["']$/g, '')
}
}
// Prefer PRETTY_NAME, fallback to NAME
const distroName = prettyName || name || "Linux"
distribution = distroName
console.log("Detected distribution:", distroName)
} catch (e) {
console.warn("Failed to parse /etc/os-release:", e)
distribution = "Linux"
}
}
}
}
}
Component.onCompleted: {
dgopCheckProcess.running = true
osReleaseProcess.running = true
}
}