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

dwl: remove wlr-randr dependency

This commit is contained in:
bbedward
2025-10-30 09:21:20 -04:00
parent 986993a890
commit 5033d10246
3 changed files with 14 additions and 11 deletions

View File

@@ -176,29 +176,34 @@ Singleton {
Process {
id: scaleQueryProcess
command: ["wlr-randr", "--json"]
command: ["mmsg", "-A"]
running: false
stdout: StdioCollector {
onStreamFinished: {
try {
const outputData = JSON.parse(text)
const newScales = {}
for (const outputInfo of outputData) {
if (outputInfo.name && outputInfo.scale !== undefined) {
newScales[outputInfo.name] = outputInfo.scale
const lines = text.trim().split('\n')
for (const line of lines) {
const parts = line.trim().split(/\s+/)
if (parts.length >= 3 && parts[1] === "scale_factor") {
const outputName = parts[0]
const scale = parseFloat(parts[2])
if (!isNaN(scale)) {
newScales[outputName] = scale
}
}
}
outputScales = newScales
} catch (e) {
console.warn("DwlService: Failed to parse wlr-randr output:", e)
console.warn("DwlService: Failed to parse mmsg output:", e)
}
}
}
onExited: exitCode => {
if (exitCode !== 0) {
console.warn("DwlService: wlr-randr failed with exit code:", exitCode)
console.warn("DwlService: mmsg failed with exit code:", exitCode)
}
}
}