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 }