From d5706742245c159f3aa25521b8529431a779b45d Mon Sep 17 00:00:00 2001 From: rope Date: Thu, 11 Jun 2026 19:29:49 +0100 Subject: [PATCH] =?UTF-8?q?quickshell:=20fix=20dead=20power=20menu=20?= =?UTF-8?q?=E2=80=94=20execDetached=20for=20commands,=20lua=20dispatch=20s?= =?UTF-8?q?yntax=20for=20logout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- settings/quickshell.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/settings/quickshell.nix b/settings/quickshell.nix index 5f30623..2cd4120 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -214,14 +214,16 @@ in visible = false; } - // Power actions go through Hyprland's exec dispatcher so they - // are NOT children of quickshell — a quickshell restart must - // never kill a running hyprlock. + // Lock/reboot/shutdown spawn via Quickshell.execDetached — fully + // detached, so a quickshell restart can never kill a running + // hyprlock. Logout (empty cmd) goes through Hyprland IPC; with a + // Lua config the dispatch body is evaluated as a Lua dispatcher + // expression, so it must use hl.dsp.* syntax, not hyprlang's. readonly property var powerActions: [ - { name: "Lock", glyph: "", dispatch: "exec " + Commands.hyprlock }, - { name: "Logout", glyph: "", dispatch: "exit" }, - { name: "Reboot", glyph: "", dispatch: "exec " + Commands.systemctl + " reboot" }, - { name: "Shutdown", glyph: "", dispatch: "exec " + Commands.systemctl + " poweroff" } + { name: "Lock", glyph: "", cmd: [Commands.hyprlock] }, + { name: "Logout", glyph: "", cmd: [] }, + { name: "Reboot", glyph: "", cmd: [Commands.systemctl, "reboot"] }, + { name: "Shutdown", glyph: "", cmd: [Commands.systemctl, "poweroff"] } ] function score(name, extra, q) { @@ -255,7 +257,8 @@ in function activate(item) { if (!item) return; if (mode === "power") { - Hyprland.dispatch(item.dispatch); + if (item.cmd.length === 0) Hyprland.dispatch("hl.dsp.exit()"); + else Quickshell.execDetached(item.cmd); } else { item.execute(); }