Added: Captured Windows Inside Profile State File

This commit is contained in:
2026-05-16 20:53:06 -04:00
parent efadc1e218
commit c9d516c6fd
2 changed files with 61 additions and 0 deletions
+30
View File
@@ -235,9 +235,39 @@ function selector.showLayoutActions(layoutName)
text = "🗑️ Delete Layout Profile",
subText = "Permanently remove the profile config file from disk",
action = "delete"
},
{
text = "───────────────────────────────────────────────────────",
subText = "📦 Captured Windows Inside Profile State File:",
action = "info"
}
}
-- Dynamically read layout profile file and append saved windows
local data = hs.json.read(path)
if data and data.windows and #data.windows > 0 then
for _, win in ipairs(data.windows) do
-- Verify if the application is currently running on the system server
local isRunning = hs.application.get(win.bundleID) or hs.application.get(win.appName)
local statusIndicator = isRunning and "🟢" or "🔴"
local cleanTitle = (win.winTitle and win.winTitle ~= "") and win.winTitle or "Untitled Window"
if #cleanTitle > 60 then cleanTitle = string.sub(cleanTitle, 1, 57) .. "..." end
table.insert(actionChoices, {
text = string.format("%s %s", statusIndicator, win.appName),
subText = string.format("↳ Title: \"%s\" | Bounds: %dx%d at (%d,%d)", cleanTitle, win.w, win.h, win.x, win.y),
action = "info"
})
end
else
table.insert(actionChoices, {
text = "⚠️ No Saved Window Metrics Found",
subText = "This layout profile does not contain any captured windows.",
action = "info"
})
end
if selector.actionChooser then selector.actionChooser:hide() end
selector.actionChooser = hs.chooser.new(function(choice)