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(); }