From 1095f73aa65778800f6b068bbf642f445138efe3 Mon Sep 17 00:00:00 2001 From: Junjie Hou Date: Tue, 29 Sep 2026 14:30:22 +0800 Subject: [PATCH 1/2] Fix Display panel display toggle using rejected hyprctl keyword Under the Lua config system, 'hyprctl keyword monitor ...' is rejected ("keyword can't work with non-legacy parsers") yet still exits 0, so the panel's enable/disable row silently did nothing. Use the hl.monitor eval API instead, as omarchy-hyprland-monitor-scaling already does. The re-enable must pass disabled = false explicitly: hl.monitor rules merge, so a disabled = true already in config (e.g. the internal-monitor-disable toggle file) otherwise survives and the re-enable no-ops. --- shell/plugins/panels/monitor/Panel.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shell/plugins/panels/monitor/Panel.qml b/shell/plugins/panels/monitor/Panel.qml index 1753906e..1da654d5 100644 --- a/shell/plugins/panels/monitor/Panel.qml +++ b/shell/plugins/panels/monitor/Panel.qml @@ -300,7 +300,13 @@ Panel { if (!name) return if (enabled && root.enabledDisplayCount <= 1) return - actionProc.command = ["hyprctl", "keyword", "monitor", name + (enabled ? ",disable" : ",preferred,auto,auto")] + // hyprctl keyword is rejected under the Lua config ("non-legacy parsers"), + // so drive the monitor through the hl.monitor eval API instead. Connector + // names come from hyprctl itself and match ^[A-Za-z0-9._-]+$. + var expr = enabled + ? 'hl.monitor({ output = "' + name + '", disabled = true })' + : 'hl.monitor({ output = "' + name + '", disabled = false, mode = "preferred", position = "auto", scale = "auto" })' + actionProc.command = ["hyprctl", "eval", expr] if (!actionProc.running) actionProc.running = true } From e0b0f349f8717fdbbc1a19aede53e2331b1381ca Mon Sep 17 00:00:00 2001 From: Omarchybot <317366263+omarchybot@users.noreply.github.com> Date: Sat, 3 Oct 2026 12:29:24 +0200 Subject: [PATCH 2/2] Escape the output name in the Display panel's hl.monitor eval Hyprland lets a headless output take any name (`hyprctl output create headless `), so a name with a quote broke out of the Lua string and the toggle failed for that output. Escape backslashes and quotes instead of asserting a character set the names do not actually follow. Co-Authored-By: Claude Opus 5.5 Co-Authored-By: Codex Medium --- shell/plugins/panels/monitor/Panel.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/plugins/panels/monitor/Panel.qml b/shell/plugins/panels/monitor/Panel.qml index 1da654d5..c64402c2 100644 --- a/shell/plugins/panels/monitor/Panel.qml +++ b/shell/plugins/panels/monitor/Panel.qml @@ -301,11 +301,11 @@ Panel { if (enabled && root.enabledDisplayCount <= 1) return // hyprctl keyword is rejected under the Lua config ("non-legacy parsers"), - // so drive the monitor through the hl.monitor eval API instead. Connector - // names come from hyprctl itself and match ^[A-Za-z0-9._-]+$. + // so drive the monitor through the hl.monitor eval API instead. + var output = '"' + name.replace(/[\\"]/g, "\\$&") + '"' var expr = enabled - ? 'hl.monitor({ output = "' + name + '", disabled = true })' - : 'hl.monitor({ output = "' + name + '", disabled = false, mode = "preferred", position = "auto", scale = "auto" })' + ? 'hl.monitor({ output = ' + output + ', disabled = true })' + : 'hl.monitor({ output = ' + output + ', disabled = false, mode = "preferred", position = "auto", scale = "auto" })' actionProc.command = ["hyprctl", "eval", expr] if (!actionProc.running) actionProc.running = true }