From 30851fd24c4a5082a662c169227aab701061264a 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/plugin.toml | 2 +- mango_layouts/widget.luau | 2 +- 3 files changed, 4 insertions(+), 4 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/plugin.toml b/mango_layouts/plugin.toml index abef2da0..5b7fd930 100644 --- a/mango_layouts/plugin.toml +++ b/mango_layouts/plugin.toml @@ -1,6 +1,6 @@ id = "ezequiel/mango_layouts" name = "Mango Layouts" -version = "1.0.0" +version = "1.0.1" plugin_api = 14 author = "ezequiel" license = "MIT" 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+", "")