From c9cb7b5ab5cdf277b686a95c4c072c1608430d0b Mon Sep 17 00:00:00 2001 From: DNI9 Date: Sun, 23 Aug 2026 17:14:22 +0530 Subject: [PATCH] fix(mango_layouts): use correct mmsg syntax for layout retrieval and dispatch mmsg does not output JSON or support 'get all-monitors' and 'dispatch' subcommands. Switched to 'mmsg -g' with awk for parsing active monitor layout, and 'mmsg -d setlayout' for applying layouts. --- mango_layouts/panel.luau | 4 ++-- mango_layouts/widget.luau | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mango_layouts/panel.luau b/mango_layouts/panel.luau index 073beb5f..8c4b2dfc 100644 --- a/mango_layouts/panel.luau +++ b/mango_layouts/panel.luau @@ -26,7 +26,7 @@ local function onPickAt(index) local slot = pickSlots[index] if slot == nil then return end selectedLayout = slot.sym - noctalia.runAsync("mmsg dispatch setlayout," .. slot.entry.name) + noctalia.runAsync("mmsg -d setlayout," .. slot.entry.name) panel.close() end @@ -142,7 +142,7 @@ function onOpen(context) selectedLayout = "" render() noctalia.runAsync( - "mmsg get all-monitors | jq -r '.monitors[] | select(.active == true and .last_open_surface != null) | .layout_symbol'", + 'mmsg -g | awk -v active="" \'/selmon 1/{active=$1} $1==active && $2=="layout"{print $3}\'', function(result) if result == nil or result.exitCode ~= 0 then return end local sym = result.stdout:gsub("%s+", "") diff --git a/mango_layouts/widget.luau b/mango_layouts/widget.luau index b130821c..4cc7eb65 100644 --- a/mango_layouts/widget.luau +++ b/mango_layouts/widget.luau @@ -26,7 +26,7 @@ local custom_color = noctalia.getConfig("custom_color") function update() noctalia.setUpdateInterval(1000) noctalia.runAsync( - "mmsg get all-monitors | jq -r '.monitors[] | select(.active == true) | .layout_symbol'", + 'mmsg -g | awk -v active="" \'/selmon 1/{active=$1} $1==active && $2=="layout"{print $3}\'', function(result) if result and result.exitCode == 0 then local sym = result.stdout:gsub("%s+", "")