


If you just love automation, and you do not consider yourselves a programmer, you may be able to just clone and tweak my system or another user's. While my configuration is a moving target this feels like a good point to do this, it's stable, I'm using it every day, and there are a few things that I've written that I haven't seen done before, and that I've been planning on writing for years. I'm going to take a few posts and document some of the modules and methodologies to my OS X desktop automation powered by Hammerspoon. Automatically create layouts for common tasks.Automatically close distractions in tabs and in apps.Manage a globally accessible hotkey modal.I have started restructuring a bit in order to change with me, and it'll probably look totally different in two more years. In some ways, the ability to instantly summon any application is now a bit of a curse to my precious focus rather than a boon to efficiency. I frequently find myself encoding a process or a UI layout into my Hammerspoon repo for repeatability and consistency.Īs my job changed, my uses for Hammerspoon have changed. Hammerspoon has enough hooks and API libraries to make writing it fairly easy 3. I am a programmer, so anything that I can read and maintain in git is a major bonus. While Keyboard Maestro is very powerful, and people have been writing applescripts for Automator forever, Hammerspoon snuggled into a sweet spot in my toolchain. I found Hammerspoon's Lua-powered little engine to be powerful and much faster than anything I had used. I'm not entirely sure where I found it, I know it was while searching for a solution to my Hyper-key problems. Eventually, there was some kind of breaking change that drove me to Hammerspoon 2 sometime in 2018. I moved from Keyboard Maestro to Alfred for this, using their visual workflow builder to define simple app switching rules. This has gone through several iterations through the years. If you bounce back and forth between two or three programs on a regular basis, I highly recommend investing in something like this.
HAMMERSPOON PROGRAM SERIES OF KEYSTROKES SOFTWARE
At the time, I was a software developer working mostly on the front-end, so the ability to instantly switch from my editor to the browser shortened my OODA loop and allowed me to iterate very quickly. I haven't used the ⌘+TAB app switcher regularly for nearly eight years now… my fingers just open the browser with HYPER+k, and that is How Computers Should Work TM.

It's hard to overstate the impact of this hack on my computing style. Losh's exact setup for quite a long time: Use KeyRemap4Macbook 1 to map a key to the "hyper", and use Keyboard Maestro to listen for that chord and fire off automations, primarily switching between applications.

This enables the user to set a custom keyboard shortcut that will not override a standard keyboard shortcut… effectively a layer of shortcuts that's all your own. No OS X app uses that crazy chord, but most will let you use it as modifiers for a keyboard shortcut. Initially, the Hyper key is a "magic" hack for keyboard shortcut lovers where it assigns a single keypress to the unreachable modifier chord of ⌘⌥⇧⌃. This was hugely impactful and I've pretty much tried everything on it (the shift-key training wheels were frustrating but helped my typing!) and I started playing around with all those tricks, especially the Hyper key. In 2012, I read the Modern Space Cadet article by Steve Losh.
