From c939a13be8e25156c5906e5b9e029c89d5027c7b Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 27 Sep 2025 05:42:44 +0100 Subject: [PATCH] feat(hammerspoon/app_toggle): have showAppInfo print to console as well --- hammerspoon/app_toggle.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/hammerspoon/app_toggle.lua b/hammerspoon/app_toggle.lua index 8786723..7d05fd7 100644 --- a/hammerspoon/app_toggle.lua +++ b/hammerspoon/app_toggle.lua @@ -163,17 +163,23 @@ end --- Shows an alert with information about the frontmost application. function obj:showAppInfo() local app = hs.application.frontmostApplication() - - hs.alert.show(app:name() .. " (" .. app:bundleID() .. ")") local ok, appPath = pcall(function() return app:path() end) + + local info = { app:name() .. " (" .. app:bundleID() .. ")" } if ok and appPath then - hs.alert.show(appPath) + table.insert(info, appPath) else - hs.alert.show("Path: ") + table.insert(info, "Path: ") + end + table.insert(info, "PID: " .. app:pid()) + + print("Frontmost app info:") + for _, line in ipairs(info) do + hs.alert.show(line) + print(line) end - hs.alert.show("PID: " .. app:pid()) end -- the end