
- Brew hammerspoon software#
- Brew hammerspoon code#
Brew hammerspoon code#
The following code is to be added to RecursiveBinder.spoon/a. To fix this, I added some more code to sort the helper text before showing. If you used this, you may have noticed that the order of the keys in the helper text is not consistent. One to reload the config, and the other to open the config in VSCode Bonus Sorted helper text Here, I’ve also included a couple of keybindings for Hammerspoon. For example, singleKey('o', 'open') returns, 'space', spoon.RecursiveBinder. This is a convenience function used to easily create a table representing a keybinding with no modifiers, and also automatically translate capital letters to normal letters with shift modifier. Your ~/.hammerspoon directory should now look something like this:. It turned out that there was a Spoon for Hammerspoon called RecursiveBinder that could do the same thing. It wasn’t that long since I had been introduced to Vim, and I was getting comfortable with the leader key system. But I soon hit a roadblock where I was using up all the keys (or at least the most easily accessible ones) When I first started configuring Hammerspoon, I setup a hyper key, and added a few keybindings. Now let’s jump into the RecursiveBinder Spoon RecursiveBinder Spoon About And you can find many resources out there about setting up various things using Hammerspoon. You can also find ‘Spoons’, which are basically plugins which provide additional functionality, at this link. And if you want to know more about any part of the API, you will find that it is very well documented. You can go to Hammerspoon’s Getting started guide to see some more examples. show ( "Connected to Wi-Fi network", "", net, "" ) end end ) wifiwatcher : start () More show ( "You lost Wi-Fi connection", "", "", "" ) else hs.notify. currentNetwork () if net = nil then hs.notify. watcher.new ( function () local net = hs.wifi. You can replace the modifier combination with a hyper key if you want The following are a couple of basic examples of what you can do with Hammerspoon. You can split your config into separate files (and you should, if you do any serious configuring), and then use the require function to import them This is the starting point of your config. Using either Homebrew or from the website Configuring Setup 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. Simply put, it is a automation tool running on Lua. Eventually, I gained an interest in configuring my system to suit me better, and I came across Hammerspoon. I won’t go into what that was like here, as there are many people on the internet who have told their stories of learning Vim. However, since I am doing a CS degree, I needed to get familiar with programming related tools, and that is how I found Vim. Brew hammerspoon software#
I do still occasionally boot into Windows, using Bootcamp, but it’s only when I need to use some software that doesn’t run on macOS.Īt first, I used macOS much like I used to use Windows. Once I moved to macOS, it took quite some time to get used to it. I have used Ubuntu a bit, but that barely counts.
Before that, I had only ever known Windows. I’ve been using macOS for a little over a year now.