

Basically, you’re only limited by your imagination (and your skill at writing the relevant code). It has numerous APIs for macOS functionality, and with it, you can control pretty much whatever you want to. People use it for all sorts of automations, with key remappings and quick window switchers being the most common applications. Hammerspoon About Simply put, it is a automation tool running on Lua. Uid=501(csaby) gid=20(staff) ~ % cat ~/.hammerspoon/aīeyond that Hammerspoon has some really nice entitlements, so we get access to these privacy resources as well if it was ever approved for the app. Hammerspoon allows you to create custom keyboard shortcuts or setup hotkeys that will run macros (collections of actions, or automated tasks). Hammerspoon is a macOS automation framework that allows you to hook into all sort of OS interfaces using Lua scripts. The way it works is by creating a symbol table of the script. This extension is a cheap and dirty attempt to create an IntelliSense environment for Hammerspoon.

#Hammerspoon code
Indeed, when the app is started, this file is created with the expected output. Hammerspoon console output to Visual Studio Code output window. It runs id and redirects its output to a file. They have plenty of examples on their Getting Started page, and an extensive API documentation. Seems like a really cool scripting language for MacOS The major difference here is that Keyboard Maestro has a GUI (is drag and drop) while HammerSpoon.

The app looks for a single file, ~/.hammerspoon/a, and when started the script will be executed.
#Hammerspoon full
We can even embed full AppleScript code as well as run shell scripts. The app is an automation tool, that allows macOS scripting through LUA scripting language. This idea came from my colleague It’s another application specific persistence option, related to Hammerspoon. For more background check the introduction.
#Hammerspoon series
Whichever solution you choose, the result is that you can now move to windows next to each other with lighting speed with a couple keystrokes and the windows will sit perfectly next to each other without overlapping.This is part 8 in the series of “Beyond the good ol’ LaunchAgents”, where I try to collect various persistence techniques for macOS.
#Hammerspoon install
Install Hammerspoon and either install a “spoon” (that’s what they call extensions) like MiroWindowsManager or download my custom configuration and adapt it to your needs. Using the mouse is bad for navigating windows, it is worse for managing their layout. Similarly, Cmd+` and Cmd+Shift+` switch the current window to the next (or previous) window of the current application Keyboard-based window layout management Add to Chrome Add to Edge Add to Firefox Add to Opera Add to Brave Add to Safari. The Slant team built an AI & it’s awesome Find the best product instantly. So, first things first: Cmd+Tab and Cmd+Shift+Tab switches the current window to the next (or previous) application. Hammerspoon is ranked 15th while KWM is ranked 21th. In order to use the keyboard for window management we first need to be able to navigate with the keyboard Navigating windows with the mouse is inefficient (it takes much longer than with the keyboard) and also somewhat ineffective (it is much less precise than with the keyboard). Stop using the mouse - Start using your keyboard (for navigation) Hammerspoon is a generic tool, but the functionality I use by far the most is window layout management. Over the years, it has completely changed how I do a couple small but important tasks. Hammerspoon boasts two things: a truly epic project name and a lua scripting environment that hooks into extensions that allow you to control system functionality in macOS.
