mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
dwl: remove wlr-randr dependency
This commit is contained in:
@@ -596,12 +596,10 @@ Item {
|
||||
|
||||
border.width: {
|
||||
if (isUrgent && !isActive) return 2
|
||||
if (CompositorService.isDwl && isActive && root.dwlActiveTags.length > 1) return 2
|
||||
return 0
|
||||
}
|
||||
border.color: {
|
||||
if (isUrgent && !isActive) return Theme.error
|
||||
if (CompositorService.isDwl && isActive && root.dwlActiveTags.length > 1) return Qt.lighter(Theme.primary, 1.3)
|
||||
return Theme.withAlpha(Theme.error, 0)
|
||||
}
|
||||
|
||||
|
||||
@@ -488,7 +488,7 @@ Singleton {
|
||||
for (let i = 0; i < Quickshell.screens.length; i++) {
|
||||
const screen = Quickshell.screens[i]
|
||||
if (screen && screen.name) {
|
||||
Quickshell.execDetached(["wlr-randr", "--output", screen.name, "--off"])
|
||||
Quickshell.execDetached(["mmsg", "-d", "disable_monitor," + screen.name])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -502,7 +502,7 @@ Singleton {
|
||||
for (let i = 0; i < Quickshell.screens.length; i++) {
|
||||
const screen = Quickshell.screens[i]
|
||||
if (screen && screen.name) {
|
||||
Quickshell.execDetached(["wlr-randr", "--output", screen.name, "--on"])
|
||||
Quickshell.execDetached(["mmsg", "-d", "enable_monitor," + screen.name])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user