I spend an unhealthy amount of time tweaking my Mac. I think if I was born in the 50s I would totally be that guy who spends all his time tinkering with his car.
In my never-ending quest to setup my Mac in the best way possible I stumbled upon a number of tools that I can use to automate OS X. I’ve mentioned Slate before. Today I want to talk about Hammerspoon.
Hammerspoon, like Slate lets you assign hot keys to control window size and position. However, to say Hammerspoon is a window manager really doesn’t do it justice.
Hammerspoon is an automation tool for OS X. The tool exposes a bunch of pieces of system functionality in a way that is scriptable.
With Hammerspoon you can write scripts that interact with OS X APIs. You can do the aforementioned window management. You can also control applications, the clipboard, audio devices, retrieve information about the battery, access the filesystem and a whole bunch more.
Here are some of the practical things you can do with Hammerspoon.
- Control your window sizes and positions
- Move windows between Spaces
- Throw windows to different monitors
- Configure windows differently when you unplug your monitors
- Auto-reload it’s configuration whenever the config file changes.
- Cycle your browser between multiple user agent strings
- Lock your computer using a hotkey combination
- Prevent your Mac from going to sleep
- Launch specific applications when you come home.
- Launch your scanner application whenever you plug in your scanner
- Defeat paste blocking
- Send a text message to your spouse whenever your arrive home
- Replace your clipboard with a clipboard manager
- Implement a Pomodoro timer
- Control iTunes
I’ve used to to replace Keyboard Maestro. I’m likely going to replace Slate when I have the time to recreate my window management functions.
You can see my hammerspoon config file in my github repo.
Have you used Hammerspoon or do you have a favorite Mac automation tool? Let me know in the comments.