Tags: #hammer #hammerspoon #os #automation #macos #shell #lua
You need to install Hammerspoon and setup a ~/.hammerspoon/init.lua
.
Examples can be found here: https://www.hammerspoon.org/go/#helloworld
hs.hotkey.bind({"cmd"}, "escape", function()
local ghostty = hs.application.find("Ghostty")
if ghostty and ghostty:isFrontmost() then
ghostty:hide()
else
hs.application.launchOrFocus("Ghostty")
end
end)