Hammerspoon



Hammerspoon is a tool for powerful automation of OS X. At its core, it is just a bridge between the operating system and a Lua scripting engine. What gives Hammerspoon its power is a set of extensions that expose specific pieces of system functionality, to the user.

Hammerspoon Seal

Hi guys, I just found out about hammerspoon. After spending a weekend on linux I found myself trying to alt+leftClick to drag and alt+rightClick to resize, so I went looked for a solution and here I am:) Here's what I did based on the script I found here. This implements cmd + leftClick for moving and cmd + rightClick for resizing. Hammerspoon is doing the stuff talked about here using event taps. I don't know if you can reliably use event taps to simulate different modifiers though, or to prevent a modifier from actually taking effect (e.g. If you wanted to remap one modifier to another). Hammerspoon is kind of a grab-bag of different capabilities, at least based on what its inbuilt APIs provide. On Mac OS it's a useful tool to work around the lack of open-source core functionality in the operating system and provide some prescriptive configuration.

Hammerspoon Download

HammerspoonHammerspoon

This is very hard to describe succinctly. You can write Lua code that interacts with OS X APIs for applications, windows, mouse pointers, filesystem objects, audio devices, batteries, screens, low-level keyboard/mouse events, clipboards, location services, wifi, and more.

Typically you would write a configuration file in Lua that connects events to actions. You might want to bind a keyboard shortcut to a series of window operations, or an Applescript. You might want to run a series of commands when your wifi interface connects to your home network. You might want to display an alert when your battery drops below a certain percentage. You might want to do something crazy like having iTunes automatically start playing when your Mac detects you are in Paris.

Hammerspoon Spoons

If you want to explore the options Hammerspoon offers, check out the Getting Started Guide and the full API documentation.