From ca5b1681174e0c0ae35bca0593ba9233c52b0307 Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 6 Feb 2026 08:18:37 -0500 Subject: [PATCH] niri: add ensure colors.kdl existence fixes #1606 --- quickshell/Services/NiriService.qml | 66 +++-------------------------- 1 file changed, 7 insertions(+), 59 deletions(-) diff --git a/quickshell/Services/NiriService.qml b/quickshell/Services/NiriService.qml index bcf77f80..a6ad1bbe 100644 --- a/quickshell/Services/NiriService.qml +++ b/quickshell/Services/NiriService.qml @@ -167,46 +167,6 @@ Singleton { } } - Process { - id: ensureOutputsProcess - property string outputsPath: "" - - onExited: exitCode => { - if (exitCode !== 0) - console.warn("NiriService: Failed to ensure outputs.kdl, exit code:", exitCode); - } - } - - Process { - id: ensureBindsProcess - property string bindsPath: "" - - onExited: exitCode => { - if (exitCode !== 0) - console.warn("NiriService: Failed to ensure binds.kdl, exit code:", exitCode); - } - } - - Process { - id: ensureCursorProcess - property string cursorPath: "" - - onExited: exitCode => { - if (exitCode !== 0) - console.warn("NiriService: Failed to ensure cursor.kdl, exit code:", exitCode); - } - } - - Process { - id: ensureWindowrulesProcess - property string windowrulesPath: "" - - onExited: exitCode => { - if (exitCode !== 0) - console.warn("NiriService: Failed to ensure windowrules.kdl, exit code:", exitCode); - } - } - DankSocket { id: eventStreamSocket path: root.socketPath @@ -1230,25 +1190,13 @@ Singleton { writeAlttabProcess.command = ["sh", "-c", `mkdir -p "${niriDmsDir}" && cat > "${alttabPath}" << 'EOF'\n${alttabContent}\nEOF`]; writeAlttabProcess.running = true; - const outputsPath = niriDmsDir + "/outputs.kdl"; - ensureOutputsProcess.outputsPath = outputsPath; - ensureOutputsProcess.command = ["sh", "-c", `mkdir -p "${niriDmsDir}" && [ ! -f "${outputsPath}" ] && touch "${outputsPath}" || true`]; - ensureOutputsProcess.running = true; - - const bindsPath = niriDmsDir + "/binds.kdl"; - ensureBindsProcess.bindsPath = bindsPath; - ensureBindsProcess.command = ["sh", "-c", `mkdir -p "${niriDmsDir}" && [ ! -f "${bindsPath}" ] && touch "${bindsPath}" || true`]; - ensureBindsProcess.running = true; - - const cursorPath = niriDmsDir + "/cursor.kdl"; - ensureCursorProcess.cursorPath = cursorPath; - ensureCursorProcess.command = ["sh", "-c", `mkdir -p "${niriDmsDir}" && [ ! -f "${cursorPath}" ] && touch "${cursorPath}" || true`]; - ensureCursorProcess.running = true; - - const windowrulesPath = niriDmsDir + "/windowrules.kdl"; - ensureWindowrulesProcess.windowrulesPath = windowrulesPath; - ensureWindowrulesProcess.command = ["sh", "-c", `mkdir -p "${niriDmsDir}" && [ ! -f "${windowrulesPath}" ] && touch "${windowrulesPath}" || true`]; - ensureWindowrulesProcess.running = true; + for (const name of ["outputs", "binds", "cursor", "windowrules", "colors"]) { + const path = niriDmsDir + "/" + name + ".kdl"; + Proc.runCommand("niri-ensure-" + name, ["sh", "-c", `mkdir -p "${niriDmsDir}" && [ ! -f "${path}" ] && touch "${path}" || true`], (output, exitCode) => { + if (exitCode !== 0) + console.warn("NiriService: Failed to ensure " + name + ".kdl, exit code:", exitCode); + }); + } configGenerationPending = false; }